Skip to content

Commit 4f62ed1

Browse files
author
M. Fatih Cırıt
committedMar 1, 2024
ci(json-schema-check): run only if relevant files are changed
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent 56ad4b4 commit 4f62ed1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

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

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

77
jobs:
8+
pre-check:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
run-check: ${{ steps.set-run-check.outputs.run }}
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+
- id: set-run-check
22+
run: echo "::set-output name=run::${{ steps.paths_filter.outputs.json_or_yaml == 'true' }}"
23+
824
json-schema-check:
25+
needs: pre-check
26+
if: needs.pre-check.outputs.run-check == 'true'
927
runs-on: ubuntu-latest
1028
steps:
1129
- name: Check out repository
1230
uses: actions/checkout@v3
1331

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

0 commit comments

Comments
 (0)