Why does `github.event.inputs.dry_run == true` never match, while `inputs.dry_run` works?
IntermediateConceptTriggers & Events
Answer
github.event.inputs comes from the webhook payload where every value is a string, so the boolean input is 'true' (a string). inputs.dry_run preserves the declared type and is a real boolean. Comparing a string to a boolean with == coerces both to numbers ('true' becomes NaN), so the comparison is false. Use inputs.dry_run or compare github.event.inputs.dry_run == 'true'.
More on Triggers & Events
How do you trigger a workflow on pushes to `main` and on PRs that target `main`?BeginnerWhat activity types does `pull_request` trigger on by default, and how do you add more?IntermediateHow do `branches` and `branches-ignore` filters work with globs?BeginnerHow do path filters work, and what are their limits?AdvancedHow do you trigger only on version tags, and what is the gotcha with pushing many tags?IntermediateWhat is `workflow_dispatch`, and what input types does it support?Beginner