Skip to content

Commit

Permalink
Run a do-nothing CI job for documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Dec 4, 2024
1 parent ffcb103 commit 37e70dd
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,39 @@ on:
- "README.md"
pull_request:
branches: [master]
paths-ignore:
- "docs/**"
- "LICENSES/**"
- "LICENSE"
- "CONTRIBUTING.md"
- "README.md"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Because this is a required job, we don't want to not run it for only
# documentation changes, so perform the check here rather than at the
# meta-level
paths-filter:
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.filter.outputs.should-run }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: filter
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch origin ${{ github.base_ref }}
if git diff --name-only -z origin/${{ github.base_ref }}...HEAD |
grep --null-data -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
echo "should-run=true" >> $GITHUB_OUTPUT
else
echo "should-run=false" >> $GITHUB_OUTPUT
fi
else
# For pushes, always run
echo "should-run=true" >> $GITHUB_OUTPUT
fi
build:
needs: paths-filter
if: github.event_name == 'push' || needs.paths-filter.outputs.should-run == 'true'
strategy:
matrix:
os: [linux, macos, windows]
Expand Down

0 comments on commit 37e70dd

Please sign in to comment.