fix: gate release-build dispatch on configured workflow - #184
Merged
Merged
Conversation
The promote finalize stage emitted a hardcoded 'gh workflow run Release' step on every final publish, guarded only by an act/gitea server-URL check. On real GitHub this always fired and failed for any repo without a workflow named Release (could not find any workflows named Release), blocking final publish. Add an optional release.workflow field and emit the Trigger Release Build step only when it is set, dispatching the configured workflow path. This mirrors the existing publish.workflow pattern. When unset, no dispatch is emitted. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The promote finalize stage emitted a "Trigger Release Build" step running a hardcoded
gh workflow run Release, guarded only by an act/giteaGITHUB_SERVER_URLcheck. On real GitHub the step always fired and failed for any repo without a workflow literally named "Release":Most consumer repos have no such workflow, so this blocked every repo at final publish.
Fix
Add an optional
release.workflowfield to the manifest and emit the Trigger Release Build step only when it is set, dispatching the configured workflow path vianormalizeWorkflowPath. This mirrors the existingpublish.workflowconfig-driven pattern in the same finalize job. Whenrelease.workflowis unset, no dispatch step is emitted, so unconfigured repos opt out cleanly rather than failing. The now-redundant act/gitea server-URL guard is removed since the step is config-gated.Verification
TestPromoteGenerator_ReleaseBuildDispatch: asserts no step / no dispatch when unconfigured, and a dispatch to the configured normalized path when set (written failing first).go build ./...,go test ./...(1362 pass),golangci-lint run ./...(clean), e2e modulego build+go vetclean.release.workflow; no scenario asserts the Release dispatch).