diff --git a/.github/workflows/update-year.yml b/.github/workflows/update-year.yml new file mode 100644 index 0000000..88b1b67 --- /dev/null +++ b/.github/workflows/update-year.yml @@ -0,0 +1,25 @@ +name: Update Year in README + +on: + schedule: + - cron: '0 0 1 1 *' # Runs on January 1st every year + workflow_dispatch: # Allows manual triggering + +jobs: + update-readme: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Update year in README + run: | + current_year=$(date +"%Y") + sed -i "s/\*\([0-9]\{4\}\)\*/\*$current_year\*/g" README.md + + - name: Commit and push changes + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + git commit -am "Update year in README to $(date +"%Y")" || exit 0 + git push