Auto-update LICENSE file every year automatically (#1055)

This commit is contained in:
Vyacheslav Kapitonov 2023-03-26 19:41:09 +03:00
parent fea1b7b0a3
commit bce7151d0c

View file

@ -0,0 +1,25 @@
name: Update License Year
on:
schedule:
- cron: '0 0 1 1 *'
jobs:
update-year:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Update year in license file
run: |
year=$(date +%Y)
sed -i "s/2017-[0-9]*/2017-$year/g" LICENSE
- name: Set git config
run: |
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add LICENSE
git commit -m "Update license years" || exit 1
git push