fix: normalize hyphenated change-detection output keys to underscores - #135
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
This was referenced Jun 13, 2026
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
Generated change-detection identifiers (
run_build_<name>,run_deploy_<name>, and the siblingbase_build_<name>/base_deploy_<name>SHA passthroughs) were emitted with the raw callback name at the setter and job-output passthrough sites, but the underscore-normalized form (config.OutputKey) at the consumingif:condition.For a hyphenated name like
shared-lib, the setup job exposedrun_build_shared-lib, while the consuming job checkedneeds.setup.outputs.run_build_shared_lib. GitHub Actions parses the hyphen in an expression as subtraction (sharedminuslib), so the reference never resolved and the consuming job'sif:was always false. The build/deploy was silently skipped with no error.Fix
Route every emission and reference site through
config.OutputKeyso the identifier is underscore-normalized consistently:internal/output/output.go- the runtime setter that writesrun_build_*,run_deploy_*, andbase_*to$GITHUB_OUTPUT.internal/generate/generator.go- the setup job-leveloutputs:passthrough forrun_build_*/run_deploy_*andbase_build_*/base_deploy_*.The consuming
if:condition already usedconfig.OutputKey, so it now matches.This is a no-op for names without a hyphen (
OutputKeyonly replaces-with_). Human-facing job IDs and display names keep their hyphens; only the output-key identifiers change.Verification
TestGenerator_HyphenatedNameOutputKeysConsistent(hyphenatedshared-libbuild andweb-apideploy) asserts the passthrough, the setter reference, and the consumingif:all use the same underscore key, and that no hyphenatedrun_*/base_*identifier appears. Confirmed failing before the fix, passing after.go build ./...,go test ./..., andgolangci-lint runall pass.actionlinton a generated hyphenated sample reports no expression errors.Closes #127