fix(promotion-pr): treat nothing to promote as success - #30
Merged
Conversation
`gh pr create` answers `GraphQL: No commits between main and dev` with a non-zero exit, so the job went red whenever the source branch carried nothing the target lacks. That is a normal state, not a failure: it holds on a repo whose `dev` was just cut from `main`, and after any push adding no new commit — a sync merge of `main` back into `dev`, most often. Found on kirchDev/duxt, freshly created, where every push to `dev` failed the Promotion PR workflow. The body is called by 20 repos, so each of them meets it sooner or later. One compare call answers it before the create is attempted. The job's `pull-request-number` output is already documented as empty when no PR was needed, so the early exit needs no signature change.
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.
Gefunden an
kirchDev/duxt: dort schlug jeder Push aufdevim Promotion-PR-Workflow fehl.Was passiert
gh pr createbeantwortet den Fall „Quelle enthält nichts, was das Ziel nicht hat" mitund einem Exit-Code ungleich 0. Der Job wird also rot — obwohl nichts falsch ist.
Das ist ein normaler Zustand, kein Fehler:
devgerade vonmaingeschnitten wurde (genauduxt),mainnicht schon hat — typischerweise ein Sync-Merge vonmainzurück nachdev.Der Fix
Ein
compare-Aufruf beantwortet die Frage, bevorcreatees versucht:Der Output
pull-request-numberist bereits als „empty if none was needed" dokumentiert — der frühe Ausstieg braucht also keine Signaturänderung.Reichweite
Der Body wird von 20 Repos aufgerufen. Bisher ist es nur an
duxtaufgefallen, weil dortdev == mainder Dauerzustand war; die anderen treffen es nach jedem Sync-Merge.