Skip to content

Commit 33eed21

Browse files
authored
ci: rebuild comment sync as a post-merge repair caller (#195)
Replaces the in-PR workflow_run caller: any non-Dependabot push to a Dependabot branch flips the retriggered runs' actor off dependabot[bot], lifting the Dependabot sandbox for the PR's unreviewed action bumps (verified live on basecamp-cli#566; see basecamp/.github#11). The reusable workflow now runs post-merge: on workflow-file pushes to the default branch it repairs drifted comments via a comment-only auto-merging PR — only reviewed code ever executes. Dependabot itself maintains the bare comments on its own PRs after the bare-pin restructure. Lands disabled; enabled per repo after a full-cycle exercise.
1 parent 6c8d31e commit 33eed21

1 file changed

Lines changed: 16 additions & 31 deletions

File tree

‎.github/workflows/dependabot-sync-actions-comments.yml‎

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,33 @@
11
name: Sync Dependabot action pin comments
22

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.
810

911
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: {}
2519

2620
permissions: {}
2721

2822
jobs:
2923
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
3725
with:
38-
ci-workflow-name: CI
3926
default-branch: master
40-
branch: ${{ inputs.branch || '' }}
41-
e2e: ${{ inputs.e2e || false }}
4227
permissions:
4328
contents: read
4429
actions: write
45-
pull-requests: read
30+
pull-requests: write
4631
# The deploy key is scoped to this repo's dependabot-sync environment
4732
# (deployment branches: default branch only); environment secrets cannot
4833
# be forwarded explicitly to a reusable workflow, so inherit is required.

0 commit comments

Comments
 (0)