Skip to content

Update README with Latest Update Date #11

Update README with Latest Update Date

Update README with Latest Update Date #11

Workflow file for this run

name: Update README with Latest Update Date
on:
schedule:
- cron: "0 0 * * 0" # Runs every Sunday at 00:00 UTC
workflow_dispatch: # Allows manual trigger of the workflow
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: Update README with latest date
run: |
# Set variables
LAST_UPDATE_LINE="Last updated: ${{ env.date }}"
# Update README.md
sed -i "/Last updated:/c\\$LAST_UPDATE_LINE" README.md
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
author_name: "github-actions[bot]"
author_email: "github-actions[bot]@users.noreply.github.com"
message: "Update README with latest update date"
add: "README.md"