-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Update License Year | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 1 1 *" # Runs on January 1st every year | ||
workflow_dispatch: # Allows manual triggering from GitHub Actions UI | ||
|
||
jobs: | ||
update-license: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update LICENSE year | ||
run: | | ||
CURRENT_YEAR=$(date +"%Y") | ||
sed -i "s/(Copyright © [0-9]\{4\})/(Copyright © $CURRENT_YEAR)/" LICENSE.txt | ||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "[email protected]" | ||
git diff --quiet LICENSE.txt || (git add LICENSE.txt && git commit -m "Update MIT License year to $CURRENT_YEAR" && git push) |