forked from checkstyle/checkstyle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#11194: Automate bumping license year
- Loading branch information
1 parent
a6d4f0d
commit b0fe26c
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
############################################################################# | ||
# Github Action to bump license year | ||
# | ||
# Workflow starts every new year. | ||
# | ||
############################################################################# | ||
name: "Bump license year" | ||
on: | ||
push: | ||
schedule: | ||
- cron: "0 0 1 1 *" | ||
# So we can manually trigger if required | ||
workflow_dispatch: | ||
jobs: | ||
bump: | ||
name: Bump license year | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Modify File | ||
run: | | ||
./.ci/bump-license-year.sh | ||
- name: Set Current Year | ||
id: CURRENT_YEAR | ||
run: | | ||
echo "::set-output name=year::$(date +'%Y')" | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
env: | ||
YEAR: ${{ steps.CURRENT_YEAR.outputs.year }} | ||
with: | ||
commit-message: "minor: Bump year to ${{ env.YEAR }}" | ||
committer: GitHub <noreply@github.com> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
branch: bump-year | ||
delete-branch: true | ||
body: "minor: Bump year to ${{ env.YEAR }}" | ||
title: "minor: Bump year to ${{ env.YEAR }}" |