Skip to content

Created root downloads shield update scripts #1

Created root downloads shield update scripts

Created root downloads shield update scripts #1

name: Update Downloads shield in root README

Check failure on line 1 in .github/workflows/update-root-downloads-shield-weekly.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update-root-downloads-shield-weekly.yml

Invalid workflow file

invalid `cron` attribute "45 35 * * 5"
on:
schedule:
- cron: "45 35 * * 5" # every Fri @ 5:45 AM
workflow_dispatch:
jobs:
update-root-downloads-shield:
runs-on: ubuntu-24.04
permissions:
contents: write
env:
TZ: PST8PDT
steps:
- name: Checkout python-utils
uses: actions/checkout@v6.0.2
with:
token: ${{ secrets.REPO_SYNC_PAT }}
- name: Set up Python
uses: actions/setup-python@6.2.0
with:
python-version: '3.14'
- name: Update README shield
id: update_shields
run: |
# Run the Python script to update the shield
python3 utils/update_root_downloads_shield.py
# Check if the README file was modified
# We will compare the current file with the original to see if a change has happened
git diff --exit-code docs/README.md || echo "SHIELDS_UPDATED=true" >> $GITHUB_ENV
- name: Commit changes (if updated)
if: env.SHIELDS_UPDATED == 'true'
run: |
cd ${{ github.workspace }}
git add docs/README.md
# Generate a commit message
commit_msg="Updated Downloads shield in README"
echo "COMMIT_MSG=$commit_msg" >> $GITHUB_ENV
git commit -m "$COMMIT_MSG"
git push
- name: Set commit timestamp timezone (for matching timestamp with PST)
if: env.SHIELDS_UPDATED == 'true'
run: |
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git config --global user.signingkey "$GPG_PRIVATE_ID"
git config --global commit.gpgsign true
gpg --batch --import <(echo "$GPG_PRIVATE_KEY")