Skip to content

Update Markdown Date #8

Update Markdown Date

Update Markdown Date #8

name: Update Markdown Date
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update-date:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update README dates
run: |
today="$(date -u +%Y-%m-%d)"
if [[ ! -f README.md ]]; then
echo "README.md not found; nothing to update"
exit 0
fi
sed -E -i "s/^Last updated: .*/Last updated: ${today}/" README.md
- name: Commit date changes
run: |
if git diff --quiet; then
echo "No date change required"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "docs: update last updated date"
git push