From e5434238705e9ecb54de67e4e2a1cd1842b65b5b Mon Sep 17 00:00:00 2001 From: Owen McGirr Date: Thu, 15 Oct 2026 20:34:09 +0100 Subject: [PATCH 1/2] CI: skip the native builds for docs-only pull requests A new `changes` job compares the pull request with its base (or the push with its previous commit) and reports whether anything outside site/ changed. The native matrix depends on it and is skipped for docs-only changes. A skipped job still satisfies the required status check, so those pull requests can merge without waiting about 35 minutes. If the comparison cannot be made, everything runs as before. Closes #1086 Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38c0d8a3..28012676 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,41 @@ jobs: - run: npm test - run: npm run build + changes: + name: Detect docs-only change + runs-on: ubuntu-latest + outputs: + app: ${{ steps.filter.outputs.app }} + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + fetch-depth: 0 + - id: filter + name: Check whether anything outside site/ changed + shell: bash + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + base="origin/${{ github.base_ref }}" + else + base="${{ github.event.before }}" + fi + if ! files=$(git diff --name-only "$base"...HEAD 2>/dev/null); then + echo "Could not compare with $base; running everything." + echo "app=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + if printf '%s\n' "$files" | grep -qvE '^site/'; then + echo "app=true" >> "$GITHUB_OUTPUT" + else + echo "Only site/ changed; the native builds are skipped." + echo "app=false" >> "$GITHUB_OUTPUT" + fi + native: + # Docs-only changes skip the native builds. A skipped job still satisfies + # the required status check, so such pull requests can merge. + needs: changes + if: needs.changes.outputs.app == 'true' strategy: fail-fast: false matrix: From 806c91f6a41fcdedb7c8f8a5ae616da50c099af3 Mon Sep 17 00:00:00 2001 From: Owen McGirr Date: Thu, 15 Oct 2026 20:35:34 +0100 Subject: [PATCH 2/2] Pass GitHub context to the docs-only check through env Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28012676..b4313bd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,11 +102,15 @@ jobs: - id: filter name: Check whether anything outside site/ changed shell: bash + env: + EVENT_NAME: ${{ github.event_name }} + BASE_REF: ${{ github.base_ref }} + BEFORE_SHA: ${{ github.event.before }} run: | - if [ "${{ github.event_name }}" = "pull_request" ]; then - base="origin/${{ github.base_ref }}" + if [ "$EVENT_NAME" = "pull_request" ]; then + base="origin/$BASE_REF" else - base="${{ github.event.before }}" + base="$BEFORE_SHA" fi if ! files=$(git diff --name-only "$base"...HEAD 2>/dev/null); then echo "Could not compare with $base; running everything."