Skip to content

ci: approve the workflow runs our own dedupe commit leaves waiting - #943

Merged
thinkclay merged 1 commit into
mainfrom
ci/approve-dependabot-dedupe-runs
Oct 2, 2026
Merged

thinkclay merged 1 commit into
mainfrom
ci/approve-dependabot-dedupe-runs

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

#935 and #936 sat three days showing "no checks reported on the branch" — the symptom of a run held at action_required, which reads as "CI never ran" rather than "CI is blocked". Clearing those by hand is the last manual step in the Dependabot queue.

It is not a Dependabot policy, which is what I assumed

Dependabot's own push runs CI fine. Measured on #935:

commit run
f89aab3de — dependabot's push CI success
d0c2f52fd — chore(deps): pnpm dedupe CI action_required

Only the run for our dedupe commit is held. dependabot-dedupe.yml pushing a second commit raises a synchronize run attributed to a bot actor, and GitHub holds that for approval.

That is a much narrower thing to automate than "approve Dependabot", and it means the blanket auto-approve I offered would have been aimed at the wrong target.

The held run is wanted — a merge takes the dedupe commit's SHA, so CI has to pass on that commit and not just the one beneath it. Only the approving should stop being manual.

Why workflow_run and not a schedule

Actions minutes are capped at 2,000/month org-wide for private repos (#375), and GitHub bills a minimum of one minute per job. A sweeper polling every 20 minutes is ~2,160 billed minutes a month on its own — more than the CI it exists to unblock.

Hanging off the dedupe workflow means this runs only when Dependabot actually opens PRs: a handful of times a week, seconds each.

It polls for up to ~2 minutes because dedupe pushes near the end of its own run, so the held run may not exist yet when this fires. If dedupe found nothing to push, there is no held run and it exits quietly on the first pass.

Scope, deliberately narrow

if: startsWith(github.event.workflow_run.head_branch, 'dependabot/')

This cannot approve a held run on a human branch. That is the property that makes removing a manual gate defensible: what gets approved is a lockfile dedupe of a bot's own branch, on which CI has already passed one commit earlier.

What is NOT verified

Whether GITHUB_TOKEN has authority to approve a run here. The endpoint and the query both work — I approved four held runs by hand earlier with my own token, and the listing query returns cleanly — but that proves the call, not the token. There are no held runs left to test against now that #935 and #936 are merged.

So a refusal fails the job loudly and names the fix (a PAT with actions: write) rather than passing with nothing approved:

::error::Could not approve run $id.
::error::GITHUB_TOKEN may lack authority to approve workflow runs here.
::error::If this is a 403, the fix is a PAT with 'actions: write' in a secret
::error::— not removing this check. A silent no-op approver is worse than none.

That matters because a silent no-op approver is the same defect class as the continue-on-error: true in #921 and the path filter in #929 — a gate that cannot do its job and does not say so. Twice this session I shipped exactly that and only caught it by trying to defeat the check.

Monday's Dependabot wave is the real test. If the queue clears without anyone touching it, it worked; if the job goes red with that error, it needs a PAT.

Verification

  • Workflow YAML parses; trigger, permissions and the branch guard confirmed.
  • The run: block passes bash -n.
  • Both API calls validated against the real repo (the listing query returns 0 held runs, correctly).
  • pnpm prepush green.

🤖 Generated with Claude Code

#935 and #936 sat three days showing "no checks reported on the branch" — the
symptom of a run held at `action_required`, which reads as "CI never ran"
rather than "CI is blocked". Clearing them by hand is the last manual step in
the Dependabot queue.

## It is not a Dependabot policy, which is what I assumed

Dependabot's own push runs CI fine. Measured on #935:

    f89aab3  dependabot's push          -> CI success
    d0c2f52  chore(deps): pnpm dedupe   -> CI action_required

Only the run for OUR dedupe commit is held. dependabot-dedupe.yml pushing a
second commit raises a `synchronize` run attributed to a bot actor, and GitHub
holds that for approval. So the thing to automate is narrow and well
understood, rather than a blanket "approve Dependabot".

The held run is wanted — a merge takes the dedupe commit's SHA, so CI has to
pass on THAT commit and not just the one beneath it. Only the approving should
stop being manual.

## Why workflow_run and not a schedule

Actions minutes are capped at 2,000/month org-wide for private repos (#375). A
sweeper polling every 20 minutes is ~2,160 billed minutes a month on its own —
more than the CI it exists to unblock, since GitHub bills a minimum of one
minute per job. Hanging off the dedupe workflow means this runs only when
Dependabot actually opens PRs: a handful of times a week, seconds each.

It polls for up to ~2 minutes because dedupe pushes near the end of its own
run, so the held run may not exist yet when this fires. If dedupe found nothing
to push there is no held run and it exits quietly on the first pass.

## Scope, deliberately narrow

`if: startsWith(github.event.workflow_run.head_branch, 'dependabot/')`. This
cannot approve a held run on a human branch. That is the property that makes
removing a manual gate defensible: what gets approved is a lockfile dedupe of a
bot's own branch, on which CI has already passed one commit earlier.

## What is NOT verified

Whether GITHUB_TOKEN has authority to approve a run here. The endpoint works —
I approved four by hand with my own token — but that proves the call, not the
token. There are no held runs to test against now that #935 and #936 are
merged.

So a refusal fails the job loudly and names the fix (a PAT with `actions:
write`) rather than passing with nothing approved. A silent no-op approver
would be the same defect class as the `continue-on-error: true` in #921 and the
path filter in #929: a gate that cannot do its job and does not say so.

Monday's Dependabot wave is the real test.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 96883e6 into main Oct 2, 2026
10 checks passed
@thinkclay
thinkclay deleted the ci/approve-dependabot-dedupe-runs branch October 2, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant