Skip to content

Commit a0b205b

Browse files
authored
🧪🚑 Fix using check_source flags as bool (#121848)
1 parent f27593a commit a0b205b

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

.github/workflows/build.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,31 @@ jobs:
2727
runs-on: ubuntu-latest
2828
timeout-minutes: 10
2929
outputs:
30+
# Some of the referenced steps set outputs conditionally and there may be
31+
# cases when referencing them evaluates to empty strings. It is nice to
32+
# work with proper booleans so they have to be evaluated through JSON
33+
# conversion in the expressions. However, empty strings used like that
34+
# may trigger all sorts of undefined and hard-to-debug behaviors in
35+
# GitHub Actions CI/CD. To help with this, all of the outputs set here
36+
# that are meant to be used as boolean flags (and not arbitrary strings),
37+
# MUST have fallbacks with default values set. A common pattern would be
38+
# to add ` || false` to all such expressions here, in the output
39+
# definitions. They can then later be safely used through the following
40+
# idiom in job conditionals and other expressions. Here's some examples:
41+
#
42+
# if: fromJSON(needs.check_source.outputs.run-docs)
43+
#
44+
# ${{
45+
# fromJSON(needs.check_source.outputs.run_tests)
46+
# && 'truthy-branch'
47+
# || 'falsy-branch'
48+
# }}
49+
#
3050
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
31-
run_tests: ${{ steps.check.outputs.run_tests }}
32-
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
33-
run_cifuzz: ${{ steps.check.outputs.run_cifuzz }}
34-
config_hash: ${{ steps.config_hash.outputs.hash }}
51+
run_tests: ${{ steps.check.outputs.run_tests || false }}
52+
run_hypothesis: ${{ steps.check.outputs.run_hypothesis || false }}
53+
run_cifuzz: ${{ steps.check.outputs.run_cifuzz || false }}
54+
config_hash: ${{ steps.config_hash.outputs.hash }} # str
3555
steps:
3656
- uses: actions/checkout@v4
3757
- name: Check for source changes

.github/workflows/reusable-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
required: true
77
type: string
88
free-threading:
9-
description: Whether to use no-GIL mode
9+
description: Whether to compile CPython in free-threading mode
1010
required: false
1111
type: boolean
1212
default: false

0 commit comments

Comments
 (0)