From 1f638fd19ba93a5d65ef0d0391a837a4b55b7df3 Mon Sep 17 00:00:00 2001 From: sisantaChhatoi Date: Fri, 27 Nov 2026 14:26:18 +0530 Subject: [PATCH 1/2] ci: run each job only for the areas a pull request changes Every pull request ran every job: web-only PRs ran the whole Go pipeline (build, vet, go test with Postgres, -race, go-stable, govulncheck), Go-only PRs ran the web build, and docs-only PRs ran everything. A `changes` job uses dorny/paths-filter (pinned to the v4.0.3 commit) with include/exclude lists, and each job runs only when its area changed: - go, go-stable, govulncheck: anything except web/, docs/, extension/, screenshots/, Markdown and the Python posture/benchmark scripts - web: web/ - python: .py files and scripts/benchmark/ - shell: .sh files, scripts/, CHANGELOG.md, or any added file (a new top-level directory must appear in the triage bot's summary) Changes under .github/ run every job. Pushes to main always run every job, and so does a pull request whose `changes` job fails, so a broken filter can never skip checks silently. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14535400c..3e4900fd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,51 @@ on: pull_request: jobs: + # Which areas a pull request changes. Each job below runs only for its area; + # pushes to main, and any failure of this job, run every job. + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + go: ${{ steps.filter.outputs.go }} + web: ${{ steps.filter.outputs.web }} + python: ${{ steps.filter.outputs.python }} + shell: ${{ steps.filter.outputs.shell }} + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: filter + if: github.event_name == 'pull_request' + with: + predicate-quantifier: some-with-excludes + filters: | + go: + - '**' + - '!web/**' + - '!docs/**' + - '!extension/**' + - '!screenshots/**' + - '!scripts/benchmark/**' + - '!scripts/posture_check*' + - '!**/*.md' + web: + - 'web/**' + - '.github/**' + python: + - '**/*.py' + - 'scripts/benchmark/**' + - '.github/**' + # Added files too: a new top-level directory must appear in the bot summary. + shell: + - '**/*.sh' + - 'scripts/**' + - 'CHANGELOG.md' + - '.github/**' + - added: '**' + go: + needs: changes + if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.result != 'success' || needs.changes.outputs.go == 'true') }} runs-on: ubuntu-latest services: postgres: @@ -85,6 +129,8 @@ jobs: # day it lands. Once the pinned floor is raised, drop continue-on-error and # this becomes a required check. go-stable: + needs: changes + if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.result != 'success' || needs.changes.outputs.go == 'true') }} runs-on: ubuntu-latest continue-on-error: true services: @@ -117,6 +163,8 @@ jobs: - run: go test -p 1 ./... govulncheck: + needs: changes + if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.result != 'success' || needs.changes.outputs.go == 'true') }} runs-on: ubuntu-latest permissions: contents: read @@ -129,6 +177,8 @@ jobs: go-package: ./... shell: + needs: changes + if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.result != 'success' || needs.changes.outputs.shell == 'true') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -143,6 +193,8 @@ jobs: - run: bash scripts/test-bot-context.sh web: + needs: changes + if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.result != 'success' || needs.changes.outputs.web == 'true') }} runs-on: ubuntu-latest defaults: run: @@ -166,6 +218,8 @@ jobs: - run: npm run build:static python: + needs: changes + if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.result != 'success' || needs.changes.outputs.python == 'true') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 6588be16d0c2bb4cb2baf9e6e2fe590b0d3db048 Mon Sep 17 00:00:00 2001 From: sisantaChhatoi Date: Sat, 28 Nov 2026 13:26:23 +0530 Subject: [PATCH 2/2] ci: only root Markdown skips the go jobs `!**/*.md` also excluded skills/*/SKILL.md, which server/shipped_skills_test.go parses, so a PR editing only a skill would have skipped the go job. Exclude root Markdown only (`!*.md`); docs/ stays excluded by `!docs/**`. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e4900fd6..f86706fb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - '!screenshots/**' - '!scripts/benchmark/**' - '!scripts/posture_check*' - - '!**/*.md' + - '!*.md' web: - 'web/**' - '.github/**'