bump-plugin-shas.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Bump Plugin SHAs
  2. # Nightly sweep: for each external entry whose upstream HEAD has moved past
  3. # its pinned SHA, validate at the new SHA with `claude plugin validate`
  4. # inline, then open one PR with all passing bumps. Each run force-resets the
  5. # bump/plugin-shas branch, so a previous night's unmerged PR is replaced (and
  6. # its review state discarded) — review and merge same-day to avoid churn.
  7. #
  8. # Bot-free — uses the default GITHUB_TOKEN. PRs opened with GITHUB_TOKEN don't
  9. # trigger on:pull_request workflows, so the policy scan (`Scan Plugins`, a
  10. # required status check on main) would never run and the bump PR could never
  11. # merge. workflow_dispatch is exempt from that recursion guard, so we dispatch
  12. # the scan ourselves on the bump branch after the PR is opened. The check run
  13. # lands on the branch HEAD — the same SHA as the PR head — and satisfies the
  14. # required check.
  15. #
  16. # max-bumps is set above the external-entry count so a single run can clear
  17. # any backlog. The cost-control mechanisms are downstream:
  18. # - scan-plugins.yml caches verdicts by (plugin, sha) so an unchanged SHA
  19. # is never re-scanned across nightly force-resets.
  20. # - revert-failed-bumps.yml drops policy-failing entries from the bump PR
  21. # so one bad upstream can't block the rest.
  22. # See those files for details.
  23. on:
  24. schedule:
  25. - cron: '23 7 * * *' # Daily 07:23 UTC
  26. workflow_dispatch:
  27. inputs:
  28. max_bumps:
  29. description: Cap on plugins bumped this run
  30. required: false
  31. default: '130'
  32. permissions:
  33. contents: write
  34. pull-requests: write
  35. actions: write # gh workflow run scan-plugins.yml on the bump branch
  36. concurrency:
  37. group: bump-plugin-shas
  38. jobs:
  39. bump:
  40. runs-on: ubuntu-latest
  41. # Per-bump cost is ~2s (ls-remote + shallow clone + validate); 130 entries
  42. # is ~5 min. The 60 min ceiling absorbs slow upstreams without letting a
  43. # pathological run consume the default 360 min budget.
  44. timeout-minutes: 60
  45. steps:
  46. - uses: actions/checkout@v4
  47. # createCommitOnBranch-based bump so commits are signed by GitHub and
  48. # satisfy the org-level required_signatures ruleset on main.
  49. - uses: anthropics/claude-plugins-community/.github/actions/bump-plugin-shas@c41c6911de0afffd2bc5cd8b21fb1e06444ee13b
  50. id: bump
  51. with:
  52. marketplace-path: .claude-plugin/marketplace.json
  53. max-bumps: ${{ inputs.max_bumps || '130' }}
  54. claude-cli-version: latest
  55. # `bump/plugin-shas` is the action's default `pr-branch`. The scan diffs
  56. # the branch against origin/main (the action's base-ref fallback when
  57. # there's no pull_request event) and scans only the bumped entries.
  58. - name: Dispatch policy scan on bump branch
  59. if: steps.bump.outputs.pr-url != ''
  60. env:
  61. GH_TOKEN: ${{ github.token }}
  62. run: gh workflow run scan-plugins.yml --ref bump/plugin-shas