Skip to content

Auto-update Timestamp File #35

Auto-update Timestamp File

Auto-update Timestamp File #35

Workflow file for this run

name: Auto-update Timestamp File
on:
schedule:
- cron: '0 17 * * *'
workflow_dispatch:
jobs:
update_timestamp_job:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Update timestamp.txt
run: echo "Last update on $(date -u)" > timestamp.txt
- name: Commit and push if there are changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add timestamp.txt
if ! git diff --staged --quiet; then
git commit -m "chore: 🤖 Update timestamp file"
git push
else
echo "No changes to commit."
fi