@@ -35,10 +35,30 @@ jobs:
3535 runs-on : ubuntu-latest
3636 timeout-minutes : 10
3737 outputs :
38+ # Some of the referenced steps set outputs conditionally and there may be
39+ # cases when referencing them evaluates to empty strings. It is nice to
40+ # work with proper booleans so they have to be evaluated through JSON
41+ # conversion in the expressions. However, empty strings used like that
42+ # may trigger all sorts of undefined and hard-to-debug behaviors in
43+ # GitHub Actions CI/CD. To help with this, all of the outputs set here
44+ # that are meant to be used as boolean flags (and not arbitrary strings),
45+ # MUST have fallbacks with default values set. A common pattern would be
46+ # to add ` || false` to all such expressions here, in the output
47+ # definitions. They can then later be safely used through the following
48+ # idiom in job conditionals and other expressions. Here's some examples:
49+ #
50+ # if: fromJSON(needs.check_source.outputs.run-docs)
51+ #
52+ # ${{
53+ # fromJSON(needs.check_source.outputs.run_tests)
54+ # && 'truthy-branch'
55+ # || 'falsy-branch'
56+ # }}
57+ #
3858 run-docs : ${{ steps.docs-changes.outputs.run-docs || false }}
39- run_tests : ${{ steps.check.outputs.run_tests }}
40- run_hypothesis : ${{ steps.check.outputs.run_hypothesis }}
41- config_hash : ${{ steps.config_hash.outputs.hash }}
59+ run_tests : ${{ steps.check.outputs.run_tests || false }}
60+ run_hypothesis : ${{ steps.check.outputs.run_hypothesis || false }}
61+ config_hash : ${{ steps.config_hash.outputs.hash }} # str
4262 steps :
4363 - uses : actions/checkout@v4
4464 - name : Check for source changes
0 commit comments