File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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 "actions@github.com"
27
+ git add README.md
28
+ git commit -m "Update date in README" || echo "No changes to commit"
29
+ git push
You can’t perform that action at this time.
0 commit comments