Skip to content

Commit 58006af

Browse files
committed
Lint OpenAPI spec via script instead of stoplightio/spectral-action
The action appears to be buggy and barely maintained. The script should be sufficient while not requiring any special GitHub permissions. Signed-off-by: nscuro <[email protected]>
1 parent c1cbc25 commit 58006af

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.github/workflows/ci-openapi.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ name: OpenAPI
1919
on:
2020
pull_request:
2121
paths:
22+
- .github/workflows/ci-openapi.yaml
2223
- api/src/main/openapi/**
2324
- api/src/main/spectral/**
25+
- dev/scripts/openapi-lint.sh
2426

2527
concurrency:
2628
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -32,17 +34,13 @@ jobs:
3234
lint:
3335
name: Lint
3436
runs-on: ubuntu-latest
35-
permissions:
36-
checks: write
3737
timeout-minutes: 5
3838
steps:
3939
- name: Checkout Repository
4040
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0
4141
- name: Lint OpenAPI Spec
42-
uses: stoplightio/spectral-action@6416fd018ae38e60136775066eb3e98172143141 # tag=v0.8.13
43-
with:
44-
spectral_ruleset: "api/src/main/spectral/ruleset.yaml"
45-
file_glob: "api/src/main/openapi/openapi.yaml"
42+
run: |-
43+
./dev/scripts/openapi-lint.sh
4644
4745
breaking-changes:
4846
name: Breaking Changes

dev/scripts/openapi-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SCRIPT_DIR="$(cd -P -- "$(dirname "$0")" && pwd -P)"
2323
API_MODULE_DIR="$(cd -P -- "${SCRIPT_DIR}/../../api" && pwd -P)"
2424

2525
# NB: Currently there's no arm64 image variant.
26-
docker run --rm -it -w /work \
26+
docker run --rm -i -w /work \
2727
--platform linux/amd64 \
2828
-v "${API_MODULE_DIR}:/work" \
2929
stoplight/spectral lint \

0 commit comments

Comments
 (0)