diff --git a/.github/workflows/year.yml b/.github/workflows/year.yml new file mode 100644 index 0000000..7a3bf08 --- /dev/null +++ b/.github/workflows/year.yml @@ -0,0 +1,31 @@ +name: Update Year + +on: + schedule: + - cron: "0 1 1 1 *" # 01:00 on January 1 + +jobs: + update_year: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Update year in LICENSE + uses: endormi/yearplusplus@v1 + with: + files: 'LICENSE' + + - name: Setup Git configuration + run: | + git config user.name "Year++" + git config user.email "<>" + + - name: Commit changes + run: | + if [ -n "$(git status --porcelain)" ]; then + git commit -am "Update copyright year" + git push origin ${{ github.head_ref }} + else + echo "No changes to commit." + fi