Skip to content

Python Script (Linked to Account) #1270

Python Script (Linked to Account)

Python Script (Linked to Account) #1270

Workflow file for this run

name: Python Script (Linked to Account)
on:
schedule:
- cron: "*/23 * * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
update-timestamp:
runs-on: ubuntu-latest
steps:
# 1️⃣ Checkout the repository
- uses: actions/checkout@v3
# 2️⃣ Update the timestamp file
- name: Update timestamp
run: |
TIMESTAMP_FILE="updates.txt"
# Overwrite the file with current UTC time (ISO 8601)
echo "Last checked: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" > "$TIMESTAMP_FILE"
# Configure Git
git config user.name "mwakidenis"
git config user.email "mwakidenice@gmail.com"
# Stage changes
git add "$TIMESTAMP_FILE"
# Commit only if there are changes; amend last commit if needed
if ! git diff --cached --quiet; then
git commit -m "Update timestamp: $(date -u)"
else
echo "No changes to commit"
fi
# 3️⃣ Push changes
- name: Push changes
run: git push origin HEAD