Skip to content

Commit

Permalink
Improve path-filtering rules on unit test action
Browse files Browse the repository at this point in the history
See docs about how jobs that are skipped still report "success", which
is necessary for jobs that are required to succeed based on branch
protection rules.

https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution
  • Loading branch information
JoshMock committed Nov 2, 2023
1 parent 96d0adb commit f6363cf
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
---
name: Node CI

on:
push:
paths-ignore:
- '**/*.md'
- '**/*.asciidoc'
- '**/*.txt'
- 'docs/**'
- '.ci/**'
- '.buildkite/**'
- 'scripts/**'
- 'catalog-info.yaml'
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.asciidoc'
- '**/*.txt'
- 'docs/**'
- '.ci/**'
- '.buildkite/**'
- 'scripts/**'
- 'catalog-info.yaml'
on: [push, pull_request]

jobs:
paths-filter:
name: Detect files changed
runs-on: ubuntu-latest
outputs:
skip: '${{ steps.changes.outputs.skip }}'
steps:
- uses: dorny/paths-filter/@v2.11.1
id: changes
with:
filters: |
skip:
- '**/*.md'
- '**/*.asciidoc'
- '**/*.txt'
- 'docs/**'
- '.ci/**'
- '.buildkite/**'
- 'scripts/**'
- 'catalog-info.yaml'
test:
name: Test
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if files not in `skip` filter were changed
if: needs.paths-filter.outputs.skip != 'true'

strategy:
fail-fast: false
Expand Down

0 comments on commit f6363cf

Please sign in to comment.