Commit 6493517
committed
ci: guard fromJSON in detect-changes against empty pr-info output
The detect-changes job's `Detect changed paths` step gates on
`startsWith(github.ref_name, 'pull-request/')`, but GitHub Actions
evaluates step-level `env:` expressions eagerly — the `if:` gate does
not short-circuit them. On push to main, tag, or schedule events the
preceding `Resolve PR base branch` step is skipped and its outputs
are empty strings, so `fromJSON(steps.pr-info.outputs.pr-info)`
raises a template error and fails the step even though its `if:`
would otherwise skip it. That failure cascades into the final
"Check job status" aggregation, turning every push-to-main CI run
red (see run 24566662170).
Guard the `fromJSON` call with a short-circuit so the expression
resolves to an empty string when pr-info did not run. On PR events
the expression still evaluates to the PR's actual base ref.1 parent 82ca962 commit 6493517
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
0 commit comments