@@ -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