LinuxGSM/.github/workflows/update-copyright-years-in-license-file.yml
Dessa e2bdefdf9a
chore: only run GitHub actions when on main account (#4433)
the most prominent case being update-copyright-years-in-license-file altering commit history in forks depending on configuration (sometimes these type of PRs just auto-merge on forks, creating a merge conflict when they sync their fork for preparing a PR)
additionally, some actions require secrets so they would fail anyway

Co-authored-by: Daniel Gibbs <me@danielgibbs.co.uk>
2024-01-19 18:43:43 +00:00

26 lines
698 B
YAML

name: Update copyright year(s) in license file
on:
workflow_dispatch:
schedule:
- cron: "0 3 1 1 *" # 03:00 AM on January 1
jobs:
update-license-year:
if: github.repository_owner == 'GameServerManagers'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Action Update License Year
uses: FantasticFiasco/action-update-license-year@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: LICENSE.md
- name: Merge pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr merge --merge --delete-branch