Skip to content
Discussion options

You must be logged in to vote

Hi!

Great question — you’ve pinpointed one of the subtle (and confusing) behaviors of GitHub Actions.

All values written to $GITHUB_OUTPUT are treated as strings, even if you write true, false, 1, or 0.

That’s why:

  • In if: expressions, steps.check.outputs.rebuild works because it's being evaluated in a boolean context, where "true" (a non-empty string) is truthy.

  • But in a with: input (like passing build: ${{ needs.check_version.outputs.rebuild }} to a reusable workflow), the system expects a true boolean type, not a string. Hence the error.

You're already doing the right thing by using:

build: ${{ needs.check_version.outputs.rebuild == 'true' }}

This forces a proper boolean conversio…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@lelegard
Comment options

@KarinaGante
Comment options

@lelegard
Comment options

@KarinaGante
Comment options

@lelegard
Comment options

Answer selected by lelegard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues Misc General discussions about GitHub Actions that don't fit other found themes.
2 participants