Skip to content

Commit 9ea0338

Browse files
committed
update linting workflow to have conditional jobs so the status check can always be satisfied
1 parent fc49a3c commit 9ea0338

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

.github/workflows/lint-example-oas.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
name: Lint Example OpenAPI
22
on:
33
pull_request:
4-
paths:
5-
- 'functions/*'
6-
- 'example/*'
7-
- '.spectral.yaml'
8-
- '*.oas.rules.*'
94
push:
10-
paths:
11-
- 'functions/*'
12-
- 'example/*'
13-
- '.spectral.yaml'
14-
- '*.oas.rules.*'
155
branches:
166
- main
177

188
jobs:
9+
changes:
10+
name: Detect CHanges
11+
runs-on: ubuntu-latest
12+
# Required permissions
13+
permissions:
14+
contents: read
15+
pull-requests: read
16+
# Set job outputs to values from filter step
17+
outputs:
18+
linting: ${{ steps.changes.outputs.linting }}
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- uses: dorny/paths-filter@v3
24+
id: changes
25+
with:
26+
filters: |
27+
linting:
28+
- 'functions/**'
29+
- 'example/**'
30+
- '.spectral.yaml'
31+
- '*.oas.rules.*'
32+
1933
lint-example-openapi:
2034
name: Lint Example OpenAPI
21-
35+
needs: changes
36+
if: ${{ needs.changes.outputs.linting == 'true' }}
2237
runs-on: ubuntu-latest
2338

2439
permissions:

0 commit comments

Comments
 (0)