Skip to content

Commit 13a2ffd

Browse files
CI: skip Internal Tests dispatch for docs-only changes (#4995)
## Summary - Add a `dorny/paths-filter` step to the `internal-tests` job that checks for any changed file outside `docs/`. - Gate the private-repo dispatch and the wait-for-completion steps on that filter, so a docs-only PR no longer fires off the private CI workflow. - The job itself still runs and completes successfully, so any branch protection requiring the `Internal Tests` check continues to be satisfied. ## Test plan - [ ] Open a docs-only follow-up PR and confirm `Internal Tests` reports success without dispatching a private run. - [ ] Open a PR touching `crates/` (or anything non-docs) and confirm the private dispatch still fires as before.
1 parent 81120b9 commit 13a2ffd

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,13 +887,26 @@ jobs:
887887
&& (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) }}
888888
permissions:
889889
contents: read
890+
pull-requests: read
890891
runs-on: ubuntu-latest
891892
env:
892893
TARGET_OWNER: clockworklabs
893894
TARGET_REPO: SpacetimeDBPrivate
894895
steps:
896+
# Skip the private dispatch entirely when only `docs/` is touched. The job
897+
# itself still completes successfully so required-status-check gating is
898+
# satisfied without spending private-runner time on a docs-only change.
899+
- name: Detect non-docs changes
900+
id: filter
901+
uses: dorny/paths-filter@v3
902+
with:
903+
filters: |
904+
non_docs:
905+
- '!docs/**'
906+
895907
- id: dispatch
896908
name: Trigger tests
909+
if: steps.filter.outputs.non_docs == 'true'
897910
uses: actions/github-script@v7
898911
with:
899912
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
@@ -957,6 +970,7 @@ jobs:
957970
core.setOutput('run_url', runUrl);
958971

959972
- name: Wait for Internal Tests to complete
973+
if: steps.filter.outputs.non_docs == 'true'
960974
uses: actions/github-script@v7
961975
with:
962976
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
@@ -994,7 +1008,7 @@ jobs:
9941008
}
9951009

9961010
- name: Cancel invoked run if workflow cancelled
997-
if: ${{ cancelled() }}
1011+
if: ${{ cancelled() && steps.dispatch.outputs.run_id }}
9981012
uses: actions/github-script@v7
9991013
with:
10001014
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}

0 commit comments

Comments
 (0)