|
| 1 | +# Vendored into every repo listed in blockrun's brand/consumers.json — the |
| 2 | +# fan-out half of the brand-numbers system. The vendored sync script keeps PR |
| 3 | +# CI deterministic and offline (--check never fetches); THIS workflow is where |
| 4 | +# freshness comes from: it re-fetches the canonical artifact weekly and lands |
| 5 | +# the marker rewrites, so numbers can't silently rot behind green CI again |
| 6 | +# (they did: 14 of 15 consumers sat stale, one 70→71 sweep touched 8 files in |
| 7 | +# this repo alone). |
| 8 | +# |
| 9 | +# Direct push to the default branch on purpose: these are docs/marker rewrites |
| 10 | +# generated from blockrun.ai/brand/numbers.json by the audited script in |
| 11 | +# scripts/. A PR queue nobody tends is how the staleness happened. If the |
| 12 | +# branch is protected the push fails and the fallback opens a PR instead. |
| 13 | +# No third-party actions beyond actions/checkout — supply-chain surface stays |
| 14 | +# at one GitHub-owned action. |
| 15 | +name: brand-sync |
| 16 | +on: |
| 17 | + schedule: |
| 18 | + - cron: "17 6 * * 1" # Mondays 06:17 UTC, offset from the top-of-hour crunch |
| 19 | + workflow_dispatch: |
| 20 | +permissions: |
| 21 | + contents: write |
| 22 | + pull-requests: write |
| 23 | +jobs: |
| 24 | + sync: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: Refresh brand numbers from the canonical artifact |
| 29 | + run: node scripts/sync-brand-numbers.mjs --refresh |
| 30 | + - name: Land the rewrite |
| 31 | + env: |
| 32 | + GH_TOKEN: ${{ github.token }} |
| 33 | + run: | |
| 34 | + if git diff --quiet; then |
| 35 | + echo "already in sync" |
| 36 | + exit 0 |
| 37 | + fi |
| 38 | + git config user.name "github-actions[bot]" |
| 39 | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 40 | + git add -A |
| 41 | + git commit -m "chore: sync brand numbers from blockrun.ai/brand/numbers.json" |
| 42 | + if git push origin "HEAD:${GITHUB_REF_NAME}"; then |
| 43 | + echo "pushed to ${GITHUB_REF_NAME}" |
| 44 | + else |
| 45 | + BR="brand-sync/$(date +%Y%m%d)" |
| 46 | + git push -f origin "HEAD:${BR}" |
| 47 | + gh pr create --head "$BR" \ |
| 48 | + --title "chore: sync brand numbers" \ |
| 49 | + --body "Automated marker refresh from https://blockrun.ai/brand/numbers.json (scripts/sync-brand-numbers.mjs --refresh). Opened as a PR because the default branch is protected." \ |
| 50 | + || echo "PR creation unavailable — branch ${BR} pushed, needs manual PR" |
| 51 | + fi |
0 commit comments