Repository navigation
fix(auto-merge): verweigerten nativen Auto-Merge auffangen statt scheitern - #365
Merged
Merged
Conversation
GitHub refuses enablePullRequestAutoMerge outright when the pull request touches .github/workflows and the token carries no `workflows` scope: "refusing to allow a GitHub App to create or update workflow ... without `workflows` permission". Renovate bumping a GitHub Action hits this every time, so on a repository with required status checks - the path that asks GitHub to hold the merge - those pull requests could never land. The scope cannot simply be added here. A permission this file declares must also be granted by every caller, and one that has not been updated yet startup-fails, so adding it would break the other callers before it fixed anything. Falling through to the gating path is not a workaround. That path waits for the same checks itself and then merges over REST, which the restriction does not cover - measured in netresearch/git-workflow-skill, where PR #153 changed a workflow file and merged over exactly this path with exactly these permissions. A refused merge at the end of that path is now a notice rather than a failure, matching how the two other non-merge outcomes already report. Failing left a red check on the pull request, and a red check is what holds it at UNSTABLE and shuts every other route to merging it - so the failure made the pull request harder to land by hand than if this workflow had never run. Verified with a stubbed gh across four cases: native call refused then REST merge succeeds, both refused, native call succeeds unchanged, and a repository without required checks unchanged. Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Renovate-PRs, die eine GitHub-Action anheben, ändern eine Datei unter
.github/workflows/. Für genau die verweigert GitHub den AufrufenablePullRequestAutoMerge:Damit konnten solche PRs in jedem Repository mit
required_status_checksnie landen — das ist der Zweig, der GitHub den Merge halten lässt. Aufgefallen an drei Renovate-PRs in phpmyadmin-docker-compose-stack, die seit gestern hängen.Warum nicht einfach die Berechtigung ergänzen
Der Kopf dieser Datei sagt es selbst: eine hier deklarierte Berechtigung muss jeder Aufrufer ebenfalls gewähren, sonst scheitert der Lauf mit
startup_failure, bevor irgendein Job startet. 76 Repositories rufen diesen Workflow auf, alle mitcontents: writeundpull-requests: write. Ein zusätzlicher Scope hier würde sie alle brechen, bevor er irgendetwas repariert.Warum der Durchfall die richtige Behandlung ist
Der Gating-Pfad weiter unten wartet auf dieselben Checks und merged dann über REST — und die Beschränkung greift dort nicht. Belegt, nicht vermutet: in git-workflow-skill PR #153 hat genau dieser Pfad am 07.08.2026 eine Workflow-Datei gemerged, mit denselben Berechtigungen.
Zweite Änderung: ein verweigerter Merge ist eine Notiz, kein Fehlschlag
Die beiden anderen Nicht-Merge-Ausgänge melden bereits per
::notice::und beenden mit 0. Der Merge-Befehl selbst tat das nicht. Ein roter Check ist aber genau das, was den PR aufUNSTABLEhält und jeden anderen Weg zum Merge zuschnürt — der Fehlschlag machte den PR also schwerer von Hand zu landen, als wenn dieser Workflow nie gelaufen wäre.Geprüft
Mit einer
gh-Attrappe über vier Fälle:Die Meldung „No required status checks…" erscheint jetzt nur noch auf dem Pfad, für den sie stimmt.