Skip to content

Commit

Permalink
Issue #11194: Automate bumping license year
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyom-Yadav authored and strkkk committed Jan 16, 2022
1 parent bbbdaa8 commit 574b7e7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ci/jsoref-spellchecker/whitelist.words
Expand Up @@ -916,6 +916,7 @@ nonrequiredjavadoc
nonvalidating
noparentfile
NOPMD
noreply
noscript
NOSONAR
nospace
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/bump_license_year.yml
@@ -0,0 +1,42 @@
#############################################################################
# Github Action to bump license year
#
# Workflow starts every new year.
#
#############################################################################
name: "Bump license year"
on:
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: Set Current Year
id: CURRENT_YEAR
run: |
echo "::set-output name=year::$(date +'%Y')"
- name: Modify File
run: |
./.ci/bump-license-year.sh $(expr ${{ env.YEAR }} - 1) ${{ env.YEAR }} .
env:
YEAR: ${{ steps.CURRENT_YEAR.outputs.year }}
- 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-actions[bot] <github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
branch: bump-year
delete-branch: true
body: "minor: Bump year to ${{ env.YEAR }}"
title: "minor: Bump year to ${{ env.YEAR }}"

0 comments on commit 574b7e7

Please sign in to comment.