|
1 | 1 | name: Sync Dependabot action pin comments |
2 | 2 |
|
3 | | -# Thin caller: all logic lives in basecamp/.github's reusable workflow — |
4 | | -# trusted default-branch code that fetches the Dependabot head branch as data |
5 | | -# only, rewrites stale `# vX.Y.Z` pin comments, and pushes back behind a |
6 | | -# compare-and-swap lease using the write deploy key scoped to this repo's |
7 | | -# dependabot-sync environment. |
| 3 | +# Post-merge backstop. Dependabot maintains the bare `# vX.Y.Z` comments on |
| 4 | +# its own PRs natively (pins restructured to one-line-pin + standalone zizmor |
| 5 | +# ignore). After workflow-file pushes land on master, the SHA-pinned reusable |
| 6 | +# workflow recomputes the comments and, when drifted, opens a comment-only |
| 7 | +# repair PR that auto-merges once checks pass. Only reviewed default-branch |
| 8 | +# code executes; nothing is ever pushed to a Dependabot branch, so the |
| 9 | +# Dependabot sandbox on its PRs is never disturbed. |
8 | 10 |
|
9 | 11 | on: |
10 | | - workflow_run: # zizmor: ignore[dangerous-triggers] -- only the SHA-pinned reusable workflow (reviewed default-branch code) executes; the Dependabot head branch is fetched as data, never executed |
11 | | - workflows: [CI] |
12 | | - types: [completed] |
13 | | - branches: ["dependabot/github_actions/**"] |
14 | | - workflow_dispatch: |
15 | | - inputs: |
16 | | - branch: |
17 | | - description: Dependabot branch to sync (dependabot/github_actions/...) |
18 | | - required: true |
19 | | - type: string |
20 | | - e2e: |
21 | | - description: "E2E proof mode: expect a draft PR authored by the dispatcher on a dependabot/github_actions/e2e-proof-* branch" |
22 | | - required: false |
23 | | - default: false |
24 | | - type: boolean |
| 12 | + push: |
| 13 | + branches: [master] |
| 14 | + # GitHub path filters don't do {yml,yaml} brace expansion — list both. |
| 15 | + paths: |
| 16 | + - ".github/workflows/*.yml" |
| 17 | + - ".github/workflows/*.yaml" |
| 18 | + workflow_dispatch: {} |
25 | 19 |
|
26 | 20 | permissions: {} |
27 | 21 |
|
28 | 22 | jobs: |
29 | 23 | sync: |
30 | | - # Defense-in-depth behind the trigger-level branches filter (which stops |
31 | | - # runs from being created for other branches at all); the reusable |
32 | | - # workflow re-checks this and everything else. |
33 | | - if: >- |
34 | | - github.event_name == 'workflow_dispatch' || |
35 | | - startsWith(github.event.workflow_run.head_branch, 'dependabot/github_actions/') |
36 | | - uses: basecamp/.github/.github/workflows/dependabot-sync-actions-comments.yml@9ca40e3b2d6be769b370b7cee86e8448267c95d8 |
| 24 | + uses: basecamp/.github/.github/workflows/dependabot-sync-actions-comments.yml@45d3fc9588f15d50fbccde7476418007dd19e16e |
37 | 25 | with: |
38 | | - ci-workflow-name: CI |
39 | 26 | default-branch: master |
40 | | - branch: ${{ inputs.branch || '' }} |
41 | | - e2e: ${{ inputs.e2e || false }} |
42 | 27 | permissions: |
43 | 28 | contents: read |
44 | 29 | actions: write |
45 | | - pull-requests: read |
| 30 | + pull-requests: write |
46 | 31 | # The deploy key is scoped to this repo's dependabot-sync environment |
47 | 32 | # (deployment branches: default branch only); environment secrets cannot |
48 | 33 | # be forwarded explicitly to a reusable workflow, so inherit is required. |
|
0 commit comments