Skip to content

The auto-merge guard comment implies its author clause is forgeable - #181

Merged
xroche merged 3 commits into
masterfrom
guard-comment
Sep 1, 2026
Merged

The auto-merge guard comment implies its author clause is forgeable#181
xroche merged 3 commits into
masterfrom
guard-comment

Conversation

@xroche

@xroche xroche commented Sep 1, 2026

Copy link
Copy Markdown
Owner

The comment on the auto-merge guard ranked its two clauses, calling the head-repo one the only clause that cannot be forged. Neither can be forged. GitHub logins hold only letters, digits and hyphens, so dependabot[bot] is unregisterable.

It also said github.actor is the pusher rather than the author. github.actor names whoever triggered the event, and on opened that is the author, so the old wording was false for the default event set.

The replacement gives each clause its own present-tense reason. The author check reads user.login because github.actor names a triggerer. The head-repo clause turns dependabot's same-repo branches from an assumption into a precondition the run enforces.

xroche and others added 3 commits September 1, 2026 15:44
Calling the head-repo clause the one that cannot be forged implies the author
clause can be. GitHub logins hold only letters, digits and hyphens, so
dependabot[bot] is unregisterable and user.login is immutable for a PR's life.
The clauses are complementary: the author one excludes other authors, the
head-repo one excludes forks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
"Dependabot never opens a PR from a fork" is true, but it argues the clause can
never fire, which invites deleting it. The clause is defence in depth: it holds
if the author check is ever loosened. GitHub's own recommended guard omits it,
so the reason has to be on the line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
The first sentence was false for the default event set: github.actor names
whoever triggered the event, and on opened that is the author. The second
justified the head-repo clause by a future edit, which argues it does nothing
today. Both now state a present-tense reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche enabled auto-merge (squash) September 1, 2026 13:54
@xroche
xroche merged commit d48ec40 into master Sep 1, 2026
7 checks passed
@xroche
xroche deleted the guard-comment branch September 1, 2026 13:59
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