Skip to content

Commit 8eafac5

Browse files
authored
ci(json-schema-check): run only if relevant files are changed (autowarefoundation#6530)
* ci(json-schema-check): run only if relevant files are changed Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> * simplify Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> * temp change to break things to test the action Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> * temp change to test success of the action Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> * revert temp changes Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> * better naming Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> --------- Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent 56ad4b4 commit 8eafac5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/json-schema-check.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,35 @@ on:
55
workflow_dispatch:
66

77
jobs:
8+
check-if-relevant-files-changed:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
run-check: ${{ steps.paths_filter.outputs.json_or_yaml }}
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: dorny/paths-filter@v3
15+
id: paths_filter
16+
with:
17+
filters: |
18+
json_or_yaml:
19+
- '**/schema/*.schema.json'
20+
- '**/config/*.param.yaml'
21+
822
json-schema-check:
23+
needs: check-if-relevant-files-changed
24+
if: needs.check-if-relevant-files-changed.outputs.run-check == 'true'
925
runs-on: ubuntu-latest
1026
steps:
1127
- name: Check out repository
1228
uses: actions/checkout@v3
1329

1430
- name: Run json-schema-check
1531
uses: autowarefoundation/autoware-github-actions/json-schema-check@v1
32+
33+
no-relevant-changes:
34+
needs: check-if-relevant-files-changed
35+
if: needs.check-if-relevant-files-changed.outputs.run-check == 'false'
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Dummy step
39+
run: echo "No relevant changes, passing check"

0 commit comments

Comments
 (0)