ci: guard fromJSON in detect-changes against empty pr-info output#1940
Merged
cpcloud merged 1 commit intoNVIDIA:mainfrom Apr 17, 2026
Merged
ci: guard fromJSON in detect-changes against empty pr-info output#1940cpcloud merged 1 commit intoNVIDIA:mainfrom
cpcloud merged 1 commit intoNVIDIA:mainfrom
Conversation
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.
This comment has been minimized.
This comment has been minimized.
mdboom
approved these changes
Apr 17, 2026
rwgk
approved these changes
Apr 17, 2026
|
mdboom
pushed a commit
to mdboom/cuda-python
that referenced
this pull request
Apr 20, 2026
…IDIA#1940) 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
detect-changesjob'sDetect changed pathsstep has anif:gate that should skip it on non-PR events, but GitHub Actions evaluates step-levelenv:expressions eagerly — theif:does not short-circuit them.main, tag, or schedule events the precedingResolve PR base branch(pr-info) step is skipped and its outputs are empty strings, sofromJSON(steps.pr-info.outputs.pr-info)raises a template error and the step fails despite itsif:being false. That cascades intoCheck job statusand turns the whole run red (see run 24566662170).fromJSONcall with a short-circuit so the expression resolves to an empty string on non-PR events. On PR events the expression still evaluates to the PR's actual base ref, so behavior introduced in CI: Detect changed paths and gate cuda.bindings tests #1908 is preserved.Test plan
mainCI run reaches a successfulCheck job statusinstead of failing atdetect-changes / Detect changed paths.nv-gha-runners/get-pr-info) still classify changed paths correctly and gate the bindings test matrix as before.