diff --git a/.github/workflows/autoupdate-license.yaml b/.github/workflows/autoupdate-license.yaml new file mode 100644 index 00000000..6c1bdd01 --- /dev/null +++ b/.github/workflows/autoupdate-license.yaml @@ -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