File tree 1 file changed +28
-6
lines changed
1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change 11
11
- " README.md"
12
12
pull_request :
13
13
branches : [master]
14
- paths-ignore :
15
- - " docs/**"
16
- - " LICENSES/**"
17
- - " LICENSE"
18
- - " CONTRIBUTING.md"
19
- - " README.md"
20
14
concurrency :
21
15
group : ${{ github.workflow }}-${{ github.ref }}
22
16
cancel-in-progress : true
23
17
jobs :
18
+ # Because this is a required job, we don't want to not run it for only
19
+ # documentation changes, so perform the check here rather than at the
20
+ # meta-level
21
+ paths-filter :
22
+ runs-on : ubuntu-latest
23
+ outputs :
24
+ should-run : ${{ steps.filter.outputs.should-run }}
25
+ steps :
26
+ - uses : actions/checkout@v4
27
+ with :
28
+ fetch-depth : 0
29
+ - id : filter
30
+ run : |
31
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
32
+ git fetch origin ${{ github.base_ref }}
33
+ if git diff --name-only -z origin/${{ github.base_ref }}...HEAD |
34
+ grep --null-data -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
35
+ echo "should-run=true" >> $GITHUB_OUTPUT
36
+ else
37
+ echo "should-run=false" >> $GITHUB_OUTPUT
38
+ fi
39
+ else
40
+ # For pushes, always run
41
+ echo "should-run=true" >> $GITHUB_OUTPUT
42
+ fi
43
+
24
44
build :
45
+ needs : paths-filter
46
+ if : github.event_name == 'push' || needs.paths-filter.outputs.should-run == 'true'
25
47
strategy :
26
48
matrix :
27
49
os : [linux, macos, windows]
You can’t perform that action at this time.
0 commit comments