Skip to content

Commit 37e70dd

Browse files
committed
Run a do-nothing CI job for documentation changes
Closes shader-slang#5689
1 parent ffcb103 commit 37e70dd

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

.github/workflows/ci.yml

+28-6
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,39 @@ on:
1111
- "README.md"
1212
pull_request:
1313
branches: [master]
14-
paths-ignore:
15-
- "docs/**"
16-
- "LICENSES/**"
17-
- "LICENSE"
18-
- "CONTRIBUTING.md"
19-
- "README.md"
2014
concurrency:
2115
group: ${{ github.workflow }}-${{ github.ref }}
2216
cancel-in-progress: true
2317
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+
2444
build:
45+
needs: paths-filter
46+
if: github.event_name == 'push' || needs.paths-filter.outputs.should-run == 'true'
2547
strategy:
2648
matrix:
2749
os: [linux, macos, windows]

0 commit comments

Comments
 (0)