From 4c1f48fa1771504d301909983c05f67732470b81 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Thu, 16 Jul 2026 18:15:37 -0500 Subject: [PATCH 1/2] ci(render-check): detect changed files via git diff, not the GitHub API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/pr-render-check.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-render-check.yml b/.github/workflows/pr-render-check.yml index d484b73227..df16c0e9a1 100644 --- a/.github/workflows/pr-render-check.yml +++ b/.github/workflows/pr-render-check.yml @@ -71,9 +71,15 @@ jobs: # Only run Cypress when files under layouts/, assets/, or # the render-regression spec itself have changed. Content-only # PRs rely on the site-wide grep job above for coverage. - CHANGED=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files" \ - | jq -r '.[].filename') + # + # Diff the PR's base..head SHAs from the event payload. The + # checkout above uses fetch-depth: 0, so both are present + # locally. This replaces an authenticated GitHub API call whose + # non-JSON error responses (e.g. a 503 body) broke `jq` and + # failed the whole job during API hiccups. + CHANGED=$(git diff --name-only \ + "${{ github.event.pull_request.base.sha }}" \ + "${{ github.event.pull_request.head.sha }}") echo "Changed files:" echo "$CHANGED" From 50fb332e27eec5c873dd844e3f0081a7e54868c9 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Thu, 16 Jul 2026 22:37:21 -0500 Subject: [PATCH 2/2] fix: Use a three-dot diff to match the pull request Files API. 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> --- .github/workflows/pr-render-check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-render-check.yml b/.github/workflows/pr-render-check.yml index df16c0e9a1..79e5a6871a 100644 --- a/.github/workflows/pr-render-check.yml +++ b/.github/workflows/pr-render-check.yml @@ -78,8 +78,7 @@ jobs: # non-JSON error responses (e.g. a 503 body) broke `jq` and # failed the whole job during API hiccups. CHANGED=$(git diff --name-only \ - "${{ github.event.pull_request.base.sha }}" \ - "${{ github.event.pull_request.head.sha }}") + "${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}") echo "Changed files:" echo "$CHANGED"