Skip to content

Commit

Permalink
Create update-year.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dheerajghub authored Jan 19, 2025
1 parent ae7fbb9 commit 4469b8d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/update-year.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
git commit -am "Update year in README to $(date +"%Y")" || exit 0
git push

0 comments on commit 4469b8d

Please sign in to comment.