Skip to content

Ask who opened the pull request, not who triggered the run - #4

Merged
DenisDrobyshev merged 1 commit into
mainfrom
fix/auto-merge-actor
Aug 6, 2026
Merged

Ask who opened the pull request, not who triggered the run#4
DenisDrobyshev merged 1 commit into
mainfrom
fix/auto-merge-actor

Conversation

@DenisDrobyshev

Copy link
Copy Markdown
Member

What this changes

One line:

-    if: github.actor == 'dependabot[bot]'
+    if: github.event.pull_request.user.login == 'dependabot[bot]'

Why

github.actor is whoever caused the run, not whoever opened the pull request.
So the moment a person touches a Dependabot pull request — reopens it, or nudges
it after the base branch moves — the actor is that person, the job skips, and
the update sits there looking ready and never merging.

That is not hypothetical. After the previous fix landed, four stuck Dependabot
pull requests were reopened to pick it up. Every one came back with
auto-merge skipping, because the reopener was a human. Two had to be merged
by hand — which is precisely the work this workflow exists to remove.

The author of the pull request never changes, and the author is the thing being
asserted: did Dependabot open this? Reading it from
github.event.pull_request.user.login answers that question directly.

What breaks if this is wrong

Nothing loosens. The check still admits only pull requests whose author is
dependabot[bot], and dependabot/fetch-metadata errors out on anything else
regardless. What changes is that a human can nudge a stuck update without
disarming the automation.

Note on the sequence

This is the third correction to this workflow, and all three were found by
running it rather than by reading it:

  1. it approved before merging, and the organisation forbids Actions to approve —
    so the step died before queueing anything
  2. it read only update-type, which is empty for a grouped update — so no group
    ever qualified
  3. this one — it asked who triggered the run instead of who opened the pull
    request

If a fourth is ever needed, the answer is a reusable workflow in this
organisation's .github repository rather than a fourth round of six identical
pull requests. Not done here: introducing a cross-repository runtime dependency
that cannot be tested until the next Dependabot run, in the middle of fixing the
thing it would wrap, trades a known small risk for an unknown larger one.

github.actor is whoever caused the run. Reopening a stuck Dependabot pull
request to pick up a workflow fix made the actor a human, the job skipped,
and the update sat there looking ready and never merging. Four came back
with auto-merge skipping; two had to be merged by hand, which is the work
this workflow exists to remove.

The author never changes, and the author is what is being asserted.
@DenisDrobyshev
DenisDrobyshev merged commit e8aa3ac into main Aug 6, 2026
5 checks passed
@DenisDrobyshev
DenisDrobyshev deleted the fix/auto-merge-actor branch August 6, 2026 12:25
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