|
| 1 | +name: Copyright year |
| 2 | + |
| 3 | +# Keeps the copyright year in the help output (`--help`) current. |
| 4 | +# |
| 5 | +# The year is a plain literal in configure.ac, updated by a reviewed pull |
| 6 | +# request -- this workflow only opens that pull request, it never pushes to a |
| 7 | +# release branch. Scheduled runs act on the default branch; to refresh a |
| 8 | +# maintained branch, dispatch this workflow with that branch selected and the |
| 9 | +# pull request will target it. |
| 10 | +# |
| 11 | +# The edit itself lives in ci/update-copyright-year.sh so it can be linted and |
| 12 | +# run by hand. |
| 13 | + |
| 14 | +on: |
| 15 | + schedule: |
| 16 | + # 03:00 UTC on January 2nd, by which point the year has rolled over |
| 17 | + # in every timezone. |
| 18 | + - cron: '0 3 2 1 *' |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: write |
| 23 | + pull-requests: write |
| 24 | + |
| 25 | +jobs: |
| 26 | + bump_copyright_year: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Update the copyright year |
| 32 | + id: bump |
| 33 | + run: | |
| 34 | + year=$(ci/update-copyright-year.sh) |
| 35 | + echo "year=$year" >> "$GITHUB_OUTPUT" |
| 36 | + echo "branch=copyright-year-${GITHUB_REF_NAME//\//-}-$year" >> "$GITHUB_OUTPUT" |
| 37 | +
|
| 38 | + # sign-commits creates the commit through the GitHub API so it is signed |
| 39 | + # by GitHub and shows as verified; it also ignores the committer and |
| 40 | + # author inputs, so there is no bot identity to configure here. |
| 41 | + # |
| 42 | + # If the year was already current there is nothing to commit and the |
| 43 | + # action exits without opening anything. |
| 44 | + - name: Open a pull request |
| 45 | + uses: cfengine/create-pull-request@v7 |
| 46 | + with: |
| 47 | + base: ${{ github.ref_name }} |
| 48 | + branch: ${{ steps.bump.outputs.branch }} |
| 49 | + delete-branch: true |
| 50 | + sign-commits: true |
| 51 | + add-paths: configure.ac |
| 52 | + commit-message: | |
| 53 | + Updated help menu copyright year to ${{ steps.bump.outputs.year }} |
| 54 | +
|
| 55 | + Opened automatically by .github/workflows/copyright_year.yml. |
| 56 | +
|
| 57 | + Changelog: none |
| 58 | + title: Updated help menu copyright year to ${{ steps.bump.outputs.year }} |
| 59 | + body: | |
| 60 | + The copyright year shown by `--help` is a literal in `configure.ac`; this updates it to ${{ steps.bump.outputs.year }}. |
| 61 | +
|
| 62 | + Opened automatically by [.github/workflows/copyright_year.yml](.github/workflows/copyright_year.yml). |
| 63 | +
|
| 64 | + Pull requests opened with `GITHUB_TOKEN` do not trigger other workflows, so CI has not started on its own -- comment `@cf-bottom jenkins, please` to run it. |
0 commit comments