fix: coerce dry_run and boolean dispatch_inputs to real booleans in callback inputs - #194
Merged
Merged
Conversation
…allback inputs On push/schedule/workflow_run events github.event.inputs.dry_run evaluates to an empty string. Forwarding that bare value into a deploy reusable-workflow callback whose dry_run input is type: boolean makes GitHub Actions reject the call before any job materializes, so the deploy reports failure with no visible job and Finalize aborts. Emit github.event.inputs.dry_run == 'true' so the forwarded value is always a real boolean: false on a push-triggered run and true only when an operator dispatches dry_run=true. Apply the same coercion to boolean dispatch_inputs forwarded into callbacks, which share the empty-string hazard on non-dispatch events. 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
A deploy reusable-workflow callback whose
workflow_call.inputs.dry_runis declaredtype: booleanwas receivingdry_run: ${{ github.event.inputs.dry_run }}. Onpush/schedule/workflow_runevents that expression evaluates to an empty string. GitHub Actions requires aworkflow_callboolean input to receive a real boolean and rejects the empty string, so the callback fails before any job materializes: the deploy showsresult: failurewith no visible job and Finalize aborts. PR #193 made the accessor null-safe but did not fix the empty-string-into-boolean coercion.Fix
Emit
dry_run: ${{ github.event.inputs.dry_run == 'true' }}, which is a real boolean valid on both push and dispatch:falseon a push-triggered run andtrueonly when an operator dispatchesdry_run=true. Applied at all four sites that forwarddry_runinto a callbackwith:block (orchestrate plus the three promote deploy paths).Audit of every value forwarded into a callback
type: booleaninput surfaced one sibling hazard: booleandispatch_inputsforwarded as${{ inputs.NAME }}share the same empty-string failure on non-dispatch events. Those are now coerced to${{ inputs.NAME == 'true' }}when the dispatch_input is declared boolean; non-boolean inputs are forwarded verbatim.allow_breaking_changes,allow_downgrade,force, and the hotfix/rollback/releasedry_runvalues are only consumed asenv:strings orif:guards, never as callback boolean inputs, so they are unaffected.Verification
go build ./...,go test ./...(boolean-coercion cases green), andgolangci-lint run ./...pass.dry_runcoercion and for boolean-vs-string dispatch_input forwarding; existing dry_run assertions updated to the coerced form.supports_dry_runor boolean dispatch_inputs).