Skip to content

Commit 7074748

Browse files
fix: use dorny/paths-filter to include/skip a job with a required status. (#651)
1 parent f51565c commit 7074748

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

.github/workflows/motoko-counter-example.yaml

+23-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,32 @@ on:
44
branches:
55
- master
66
pull_request:
7-
paths:
8-
- motoko/counter/**
9-
- .github/workflows/provision-darwin.sh
10-
- .github/workflows/provision-linux.sh
11-
- .github/workflows/motoko-counter-example.yaml
127
concurrency:
138
group: ${{ github.workflow }}-${{ github.ref }}
149
cancel-in-progress: true
1510
jobs:
11+
# JOB to run change detection
12+
changes:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: read
16+
# Set job outputs to values from filter step
17+
outputs:
18+
sources: ${{ steps.filter.outputs.sources }}
19+
steps:
20+
# For pull requests it's not necessary to checkout the code
21+
- uses: dorny/paths-filter@v3
22+
id: filter
23+
with:
24+
filters: |
25+
sources:
26+
- motoko/counter/**
27+
- .github/workflows/provision-darwin.sh
28+
- .github/workflows/provision-linux.sh
29+
- .github/workflows/motoko-counter-example.yaml
1630
motoko-counter-example-darwin:
31+
needs: changes
32+
if: ${{ needs.changes.outputs.sources == 'true' }}
1733
runs-on: macos-12
1834
steps:
1935
- uses: actions/checkout@v1
@@ -26,6 +42,8 @@ jobs:
2642
make test
2743
popd
2844
motoko-counter-example-linux:
45+
needs: changes
46+
if: ${{ needs.changes.outputs.sources == 'true' }}
2947
runs-on: ubuntu-20.04
3048
steps:
3149
- uses: actions/checkout@v1

.github/workflows/motoko-counter-skip.yaml

-20
This file was deleted.

0 commit comments

Comments
 (0)