Skip to content

Commit d06b176

Browse files
GvieveGenevieve Nuebel
andauthored
Rename files, fix validate oas, test OAS change (#181)
* Rename files, fix validate oas, test OAS change --------- Co-authored-by: Genevieve Nuebel <genevieve.nuebel@mx.com>
1 parent b1eb3d7 commit d06b176

4 files changed

Lines changed: 55 additions & 45 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Validate OAS Files
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
discover-changed-files:
7+
name: Discover Changed OpenAPI Files
8+
runs-on: ubuntu-latest
9+
outputs:
10+
matrix: ${{ steps.set-matrix.outputs.matrix }}
11+
has_changes: ${{ steps.changed-files.outputs.any_changed }}
12+
steps:
13+
- uses: actions/checkout@v3
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
22+
id: set-matrix
23+
if: steps.changed-files.outputs.any_changed == 'true'
24+
run: |
25+
matrix_json=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq -R -s -c '
26+
split(" ") |
27+
map(select(length > 0)) |
28+
map({
29+
openapi_file: .,
30+
filename: (. | split("/")[-1])
31+
})
32+
')
33+
echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT
34+
echo "Changed files matrix: ${matrix_json}"
35+
36+
validate-openapi:
37+
name: Validate ${{ matrix.filename }}
38+
needs: discover-changed-files
39+
if: needs.discover-changed-files.outputs.has_changes == 'true'
40+
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
include: ${{ fromJson(needs.discover-changed-files.outputs.matrix) }}
44+
steps:
45+
- uses: actions/checkout@v3
46+
- name: Validate Schema for ${{ matrix.openapi_file }}
47+
uses: thiyagu06/openapi-validator-action@v1
48+
with:
49+
filepath: ${{ matrix.openapi_file }}
50+
- name: Validate YAML for ${{ matrix.openapi_file }}
51+
uses: ibiqlik/action-yamllint@v3
52+
with:
53+
file_or_dir: ${{ matrix.openapi_file }}
54+
config_file: .yamllint.yml
File renamed without changes.

.github/workflows/validate.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

openapi/v20111101.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ info:
77
The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
88
99
Just getting started? See our [use case guides](/use-cases/).
10+
Test
1011
title: MX Platform API
1112
version: '20111101'
1213
servers:

0 commit comments

Comments
 (0)