From d2f798602f0f97431457fc3348a297d482526867 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 03:14:41 +0000 Subject: [PATCH 1/2] ci: skip the build for pull requests that change only Markdown --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ AGENTS.md | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce49e574..eb3f7039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,42 @@ concurrency: cancel-in-progress: true jobs: + # A pull request that changes only Markdown has nothing to compile or test, + # so it skips `build`. GitHub counts a skipped job as passed, which keeps the + # required `build` check satisfied. Markdown under plugins/ and + # docs/decision-tables/ belongs to what the tests check, so it still builds. + # A release call is not a pull request and always builds. + changes: + runs-on: ubuntu-latest + outputs: + code: ${{ steps.diff.outputs.code }} + steps: + # A pull request is checked out as its merge commit: the first parent is + # the base, so two commits are enough to list what the PR changes. + - uses: actions/checkout@v7 + with: + fetch-depth: 2 + + - name: Detect code changes + id: diff + env: + EVENT_NAME: ${{ github.event_name }} + run: | + code=true + if [ "$EVENT_NAME" = pull_request ]; then + files=$(git diff --name-only --no-renames HEAD^1 HEAD) + echo "$files" + if [ -n "$files" ] \ + && ! grep -qvE '\.md$' <<<"$files" \ + && ! grep -qE '^(plugins|docs/decision-tables)/' <<<"$files"; then + code=false + fi + fi + echo "code=$code" >> "$GITHUB_OUTPUT" + build: + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: diff --git a/AGENTS.md b/AGENTS.md index 734aeffe..2565a24d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -211,7 +211,7 @@ carries both sections; `gh pr create --body` skips it, so add them by hand. ## CI/CD -- **CI** (`ci.yml`): One required PR run — type-check, lint, test, build +- **CI** (`ci.yml`): One required PR run — type-check, lint, test, build. A PR that changes only Markdown outside `plugins/` and `docs/decision-tables/` skips the build; the required `build` check still passes - **Release** (`release.yml`): One `v*` tag run — calls CI, then signs/releases binaries and publishes the CI-built npm tarball From 44c31915fdc0d35717d299ca6b76e695a6da6d1e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 03:16:52 +0000 Subject: [PATCH 2/2] ci: build when the change detector fails --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb3f7039..1e81616a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,9 @@ jobs: build: needs: changes - if: needs.changes.outputs.code == 'true' + # Only an explicit "no code changed" skips the build. If `changes` itself + # fails, the build still runs, so a broken detector cannot pass the check. + if: ${{ !cancelled() && needs.changes.outputs.code != 'false' }} runs-on: ubuntu-latest steps: