@@ -30,9 +30,24 @@ concurrency:
30
30
cancel-in-progress : ${{ github.event_name == 'pull_request' }}
31
31
32
32
jobs :
33
+ changes :
34
+ runs-on : ubuntu-latest
35
+ outputs :
36
+ docs-only : ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
37
+ steps :
38
+ # For pull requests it's not necessary to checkout the code
39
+ - uses : dorny/paths-filter@v2
40
+ id : filter
41
+ with :
42
+ filters : |
43
+ all:
44
+ - '**''
45
+ docs:
46
+ - 'docs/**'
33
47
style-lint-golangci :
34
48
name : style/lint/golangci
35
49
timeout-minutes : 5
50
+ if : ${{ needs.changes.outputs.docs_only }}
36
51
runs-on : ubuntu-latest
37
52
steps :
38
53
- uses : actions/checkout@v3
48
63
name : style/lint/shellcheck
49
64
timeout-minutes : 5
50
65
runs-on : ubuntu-latest
66
+ if : ${{ needs.changes.outputs.docs_only }}
51
67
steps :
52
68
- uses : actions/checkout@v3
53
69
- name : Run ShellCheck
60
76
style-lint-typescript :
61
77
name : " style/lint/typescript"
62
78
timeout-minutes : 5
79
+ if : ${{ needs.changes.outputs.docs_only }}
63
80
runs-on : ubuntu-latest
64
81
steps :
65
82
- name : Checkout
87
104
name : " style/gen"
88
105
timeout-minutes : 5
89
106
runs-on : ubuntu-latest
107
+ if : ${{ needs.changes.outputs.docs_only }}
90
108
steps :
91
109
- uses : actions/checkout@v3
92
110
@@ -122,6 +140,7 @@ jobs:
122
140
123
141
style-fmt :
124
142
name : " style/fmt"
143
+ if : ${{ needs.changes.outputs.docs_only }}
125
144
runs-on : ubuntu-latest
126
145
timeout-minutes : 5
127
146
steps :
@@ -154,6 +173,7 @@ jobs:
154
173
155
174
test-go :
156
175
name : " test/go"
176
+ if : ${{ needs.changes.outputs.docs_only }}
157
177
runs-on : ${{ matrix.os }}
158
178
timeout-minutes : 20
159
179
strategy :
@@ -227,6 +247,7 @@ jobs:
227
247
228
248
test-go-postgres :
229
249
name : " test/go/postgres"
250
+ if : ${{ needs.changes.outputs.docs_only }}
230
251
runs-on : ubuntu-latest
231
252
timeout-minutes : 20
232
253
steps :
@@ -291,7 +312,9 @@ jobs:
291
312
name : " deploy"
292
313
runs-on : ubuntu-latest
293
314
timeout-minutes : 30
294
- if : github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
315
+ if :
316
+ github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork \
317
+ needs.changes.outputs.docs_only
295
318
permissions :
296
319
contents : read
297
320
id-token : write
@@ -397,6 +420,7 @@ jobs:
397
420
398
421
test-js :
399
422
name : " test/js"
423
+ if : ${{ needs.changes.outputs.docs_only }}
400
424
runs-on : ubuntu-latest
401
425
timeout-minutes : 20
402
426
steps :
0 commit comments