Skip to content

Commit 5023ea1

Browse files
author
Genevieve Nuebel
committed
Fix some more stuff
1 parent fbdcfa9 commit 5023ea1

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

.github/workflows/validate-oas-files.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,44 @@ name: Validate OAS Files
33
on: [pull_request]
44

55
jobs:
6-
discover-files:
7-
name: Discover OpenAPI Files
6+
discover-changed-files:
7+
name: Discover Changed OpenAPI Files
88
runs-on: ubuntu-latest
99
outputs:
1010
matrix: ${{ steps.set-matrix.outputs.matrix }}
11+
has_changes: ${{ steps.changed-files.outputs.any_changed }}
1112
steps:
1213
- uses: actions/checkout@v3
13-
- name: Discover OpenAPI files
14+
- name: Check for changed OAS files
15+
id: changed-files
16+
uses: tj-actions/changed-files@v41
17+
with:
18+
files: |
19+
openapi/**/*.yml
20+
openapi/**/*.yaml
21+
- name: Build matrix from changed files
1422
id: set-matrix
23+
if: steps.changed-files.outputs.any_changed == 'true'
1524
run: |
16-
files=$(find openapi/ -name "*.yml" -o -name "*.yaml")
17-
matrix_json=$(echo "$files" | jq -R -s -c '
18-
split("\n")[:-1] |
19-
map(select(length > 0)) |
25+
matrix_json=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq -R -s -c '
26+
split(" ") |
27+
map(select(length > 0)) |
2028
map({
21-
openapi_file: .,
29+
openapi_file: .,
2230
filename: (. | split("/")[-1])
2331
})
2432
')
2533
echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT
26-
echo "Found files matrix: ${matrix_json}"
34+
echo "Changed files matrix: ${matrix_json}"
2735
2836
validate-openapi:
2937
name: Validate ${{ matrix.filename }}
30-
needs: discover-files
38+
needs: discover-changed-files
39+
if: needs.discover-changed-files.outputs.has_changes == 'true'
3140
runs-on: ubuntu-latest
3241
strategy:
3342
matrix:
34-
include: ${{ fromJson(needs.discover-files.outputs.matrix) }}
43+
include: ${{ fromJson(needs.discover-changed-files.outputs.matrix) }}
3544
steps:
3645
- uses: actions/checkout@v3
3746
- name: Validate Schema for ${{ matrix.openapi_file }}

.github/workflows/validate-version-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Version
1+
name: Validate Version Label
22

33
on:
44
pull_request:
55
types: [opened, labeled, unlabeled, synchronize]
66

77
jobs:
8-
Version:
8+
ValidateVersionLabel:
99
runs-on: ubuntu-latest
1010
permissions:
1111
issues: write

0 commit comments

Comments
 (0)