Skip to content

Scheduled Update

Scheduled Update #1

name: Scheduled Update
on:
schedule:
- cron: "23 3 * * 3" # Weekly on Wednesday at 3:23 AM UTC
workflow_dispatch:
permissions:
contents: write
jobs:
update-tier1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Update Tier 1 packages
run: python scripts/update.py -t 1
- name: Commit and push Tier 1 update
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add updates/tier1.md
git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update tier 1 packages" && git push)
update-tier2:
needs: update-tier1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Wait for tier 1 builds to complete
run: |
# Wait up to 1 hours for tier 1 builds to finish
TIMEOUT=$((1 * 60 * 60))
ELAPSED=0
INTERVAL=60
while [ $ELAPSED -lt $TIMEOUT ]; do
TIER1_BUILDS=$(gh run list --workflow "*base.*.yml" --branch main --status in_progress -L 20 --json name | grep -c '"name":' || echo 0)
if [ "$TIER1_BUILDS" -eq 0 ]; then
echo "✓ All tier 1 builds completed"
exit 0
fi
echo "⏳ Waiting for $TIER1_BUILDS tier 1 builds to complete... ($ELAPSED/$TIMEOUT seconds)"
sleep $INTERVAL
ELAPSED=$((ELAPSED + INTERVAL))
done
echo "⚠ Timeout waiting for tier 1 builds, proceeding with tier 2 update anyway"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Tier 2 packages
run: python scripts/update.py -t 2
- name: Commit and push Tier 2 update
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add updates/tier2.md
git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update tier 2 packages" && git push)