Update README with Latest Update Date #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |