Skip to content

fix: coerce dry_run and boolean dispatch_inputs to real booleans in callback inputs - #194

Merged
joshua-temple merged 1 commit into
mainfrom
fix/boolean-callback-input-coercion
Jun 16, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
fix/boolean-callback-input-coercion

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

A deploy reusable-workflow callback whose workflow_call.inputs.dry_run is declared type: boolean was receiving dry_run: ${{ github.event.inputs.dry_run }}. On push/schedule/workflow_run events that expression evaluates to an empty string. GitHub Actions requires a workflow_call boolean input to receive a real boolean and rejects the empty string, so the callback fails before any job materializes: the deploy shows result: failure with 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: false on a push-triggered run and true only when an operator dispatches dry_run=true. Applied at all four sites that forward dry_run into a callback with: block (orchestrate plus the three promote deploy paths).

Audit of every value forwarded into a callback type: boolean input surfaced one sibling hazard: boolean dispatch_inputs forwarded 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/release dry_run values are only consumed as env: strings or if: guards, never as callback boolean inputs, so they are unaffected.

Verification

  • go build ./..., go test ./... (boolean-coercion cases green), and golangci-lint run ./... pass.
  • New regression coverage for the orchestrate dry_run coercion and for boolean-vs-string dispatch_input forwarding; existing dry_run assertions updated to the coerced form.
  • Dogfood regeneration produces no drift (the repo manifest declares no supports_dry_run or boolean dispatch_inputs).

…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>
@joshua-temple
joshua-temple merged commit 25e1d86 into main Jun 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant