From 7b3a08dd3c7bfe73738cb75a0dffa835c8cf2871 Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Fri, 7 Feb 2025 11:04:31 -0500 Subject: [PATCH 1/4] ci: switch OpenAPI validators I looked into using https://github.com/daveshanley/vacuum but it doesn't have a GitHub action yet. Signed-off-by: Michael Beemer --- .github/workflows/spec-validate.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spec-validate.yaml b/.github/workflows/spec-validate.yaml index 2a990b3..508a9d0 100644 --- a/.github/workflows/spec-validate.yaml +++ b/.github/workflows/spec-validate.yaml @@ -15,6 +15,6 @@ jobs: uses: actions/checkout@v4 - name: Run OpenAPI spec validation - run: | - docker run --rm -v $PWD:/spec redocly/cli lint ./service/openapi.yaml - echo "{exit_code}={$?}" >> $GITHUB_STATE \ No newline at end of file + - uses: stoplightio/spectral-action@v0.8.11 + with: + file_glob: 'service/openapi.yaml' From 375e384eaddf4ff4e966c1b1311f658ad0df543c Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Fri, 7 Feb 2025 11:19:52 -0500 Subject: [PATCH 2/4] update pull request trigger type Signed-off-by: Michael Beemer --- .github/workflows/spec-validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-validate.yaml b/.github/workflows/spec-validate.yaml index 508a9d0..5bbacc0 100644 --- a/.github/workflows/spec-validate.yaml +++ b/.github/workflows/spec-validate.yaml @@ -1,7 +1,7 @@ name: OpenAPI spec validation action on: - pull_request_target: + pull_request: types: - opened - edited From cab4b1cc7092e014f34dab85deff8ed1e88fe660 Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Fri, 7 Feb 2025 11:36:52 -0500 Subject: [PATCH 3/4] Update spec-validate.yaml Signed-off-by: Michael Beemer --- .github/workflows/spec-validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spec-validate.yaml b/.github/workflows/spec-validate.yaml index 5bbacc0..c961089 100644 --- a/.github/workflows/spec-validate.yaml +++ b/.github/workflows/spec-validate.yaml @@ -15,6 +15,6 @@ jobs: uses: actions/checkout@v4 - name: Run OpenAPI spec validation - - uses: stoplightio/spectral-action@v0.8.11 + uses: stoplightio/spectral-action@v0.8.11 with: file_glob: 'service/openapi.yaml' From 3f7bb53e4e21cf472dd5d709577091aed74af21a Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Fri, 7 Feb 2025 11:51:19 -0500 Subject: [PATCH 4/4] add spectral file Signed-off-by: Michael Beemer --- .spectral.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .spectral.yaml diff --git a/.spectral.yaml b/.spectral.yaml new file mode 100644 index 0000000..a8d6190 --- /dev/null +++ b/.spectral.yaml @@ -0,0 +1,2 @@ +extends: + - spectral:oas