|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - 'master' |
7 | | - # Never skip on master - always run full test suite |
| 7 | + # Always trigger on master; docs-only detection handles skipping heavy jobs |
8 | 8 | pull_request: |
9 | 9 | paths-ignore: |
10 | 10 | - '**.md' |
|
20 | 20 |
|
21 | 21 | jobs: |
22 | 22 | detect-changes: |
| 23 | + permissions: |
| 24 | + contents: read |
| 25 | + actions: read |
23 | 26 | runs-on: ubuntu-22.04 |
24 | 27 | outputs: |
25 | 28 | docs_only: ${{ steps.detect.outputs.docs_only }} |
|
51 | 54 | echo "docs_only=false" >> "$GITHUB_OUTPUT" |
52 | 55 | else |
53 | 56 | BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'origin/master' }}" |
54 | | - script/ci-changes-detector "$BASE_REF" |
| 57 | + script/ci-changes-detector "$BASE_REF" |
55 | 58 | fi |
56 | 59 | shell: bash |
| 60 | + - name: Guard docs-only master pushes |
| 61 | + if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 62 | + uses: ./.github/actions/ensure-master-docs-safety |
| 63 | + with: |
| 64 | + docs-only: ${{ steps.detect.outputs.docs_only }} |
| 65 | + previous-sha: ${{ github.event.before }} |
57 | 66 |
|
58 | 67 | setup-integration-matrix: |
59 | 68 | needs: detect-changes |
|
79 | 88 | needs: [detect-changes, setup-integration-matrix] |
80 | 89 | # Run on master, workflow_dispatch, OR when tests needed on PR |
81 | 90 | if: | |
82 | | - github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' |
| 91 | + !( |
| 92 | + github.event_name == 'push' && |
| 93 | + github.ref == 'refs/heads/master' && |
| 94 | + needs.detect-changes.outputs.docs_only == 'true' |
| 95 | + ) && ( |
| 96 | + github.ref == 'refs/heads/master' || |
| 97 | + github.event_name == 'workflow_dispatch' || |
| 98 | + needs.detect-changes.outputs.run_dummy_tests == 'true' |
| 99 | + ) |
83 | 100 | strategy: |
84 | 101 | matrix: ${{ fromJson(needs.setup-integration-matrix.outputs.matrix) }} |
85 | 102 | runs-on: ubuntu-22.04 |
@@ -154,7 +171,15 @@ jobs: |
154 | 171 | needs: [detect-changes, setup-integration-matrix, build-dummy-app-webpack-test-bundles] |
155 | 172 | # Run on master, workflow_dispatch, OR when tests needed on PR |
156 | 173 | if: | |
157 | | - github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' |
| 174 | + !( |
| 175 | + github.event_name == 'push' && |
| 176 | + github.ref == 'refs/heads/master' && |
| 177 | + needs.detect-changes.outputs.docs_only == 'true' |
| 178 | + ) && ( |
| 179 | + github.ref == 'refs/heads/master' || |
| 180 | + github.event_name == 'workflow_dispatch' || |
| 181 | + needs.detect-changes.outputs.run_dummy_tests == 'true' |
| 182 | + ) |
158 | 183 | strategy: |
159 | 184 | matrix: ${{ fromJson(needs.setup-integration-matrix.outputs.matrix) }} |
160 | 185 | runs-on: ubuntu-22.04 |
|
0 commit comments