ci(render-check): detect changed files via git diff, not the GitHub API#7521
Open
jstirnaman wants to merge 2 commits into
Open
ci(render-check): detect changed files via git diff, not the GitHub API#7521jstirnaman wants to merge 2 commits into
jstirnaman wants to merge 2 commits into
Conversation
The "Detect layout/asset changes" step curled the GitHub API for the PR's changed files and piped the response to `jq`. When the API returned a non-JSON body (e.g. a 503 "Service Unavailable" page during an API hiccup), `jq` failed with "Invalid numeric literal" and the job's `-eo pipefail` shell aborted (exit 5) — failing the whole render-check on a transient outage unrelated to the PR's contents. Diff the PR's base..head SHAs from the event payload instead. The checkout already uses fetch-depth: 0, so both commits are present locally. No network call, no token, no `jq`, no parse-failure mode.
jstirnaman
requested review from
Copilot and
sanderson
and removed request for
a team
July 16, 2026 23:18
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces API-based PR file detection with a local Git diff to avoid transient API failures.
Changes:
- Removes the
curlandjqdependency. - Uses event payload SHAs for change detection.
- Needs three-dot merge-base semantics to match PR files accurately.
Use a three-dot diff here to match the pull request Files API. A two-endpoint diff compares the current base tip directly with the head, so when the base branch advances after the PR branch diverges, unrelated base-branch layout or asset changes are reported as PR changes and unnecessarily trigger Cypress. The repository's other PR detector uses merge-base semantics in .github/workflows/pr-remark-check.yml:47. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
What changed
The
cypress-renderjob's "Detect layout/asset changes" step now diffs the PR'sbase..headSHAs (from the event payload) instead of curling the GitHub API and piping tojq.Why
During a GitHub API hiccup, the API returned a non-JSON body (a 503 "Service Unavailable" page).
jq -r '.[].filename'failed withInvalid numeric literal at line 1, column 10, and the job's-eo pipefailshell aborted (exit 5). The render-check failed on a transient outage unrelated to the PR's contents. Observed on PR #7338: the same step passed, then failed twice in a row while the API was degraded.Impact
jqdependency from change detection. No API call, no parse-failure mode.actions/checkoutalready usesfetch-depth: 0, so bothbase.shaandhead.shaare present locally.grep -qEfilter decides whether Cypress runs.Verification
actionlintclean on the changed step (pre-existingSC2086infos on the untouched>> $GITHUB_OUTPUTlines left as-is).cypress-renderjob (the file is in its own trigger allowlist), so this PR exercises the new detection path.