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