Skip to content

Commit d102b27

Browse files
authored
Merge pull request #58 from iamAntimPal/iamAntimPal-patch-1
Create update-date.yml
2 parents 6940aee + 828a0d4 commit d102b27

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/update-date.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Update Date in README
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Runs daily at midnight UTC
6+
workflow_dispatch: # Allows manual triggering
7+
8+
jobs:
9+
update-date:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
15+
- name: Update date in README.md
16+
run: |
17+
# Get current date (customize format below)
18+
CURRENT_DATE=$(date +'%Y-%m-%d')
19+
20+
# Replace placeholder with the current date
21+
sed -i "s/<!-- DATE -->/${CURRENT_DATE}/g" README.md
22+
23+
- name: Commit and push changes
24+
run: |
25+
git config user.name "github-actions"
26+
git config user.email "[email protected]"
27+
git add README.md
28+
git commit -m "Update date in README" || echo "No changes to commit"
29+
git push

0 commit comments

Comments
 (0)