From 9633a3a58368f56f776d9261184c009cd7c09970 Mon Sep 17 00:00:00 2001 From: Marin Date: Fri, 4 Feb 2022 15:09:23 +0100 Subject: [PATCH 1/3] replace deprecated docker actions and use nopm packages directly --- .github/workflows/deploy.yaml | 6 +++--- .github/workflows/main.yml | 10 ++++------ .github/workflows/release.yaml | 10 ++++------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9932423e..f16b8f1b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - run: npm i -g @apidevtools/swagger-cli@4 - name: Prepare deploy directory run: | mkdir ./deploy @@ -17,9 +19,7 @@ jobs: cp -r assets ./deploy cp -r index.html ./deploy - name: Bundle spec - uses: mpetrunic/swagger-cli-action@v1.0.0 - with: - command: "bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml" + run: "swagger-cli bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml" - name: Publish to Github Pages uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8703989..dc971296 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,13 +8,11 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - run: npm i -g @apidevtools/swagger-cli@4 @stoplight/spectral-cli@6 - name: Lint spec - uses: vaibhav-jain/spectral-action/@v2.6.1 - with: - file_path: beacon-node-oapi.yaml + run: spectral lint ./beacon-node-oapi.yaml - name: Bundle spec - uses: mpetrunic/swagger-cli-action@v1.0.0 - with: - command: "bundle ./beacon-node-oapi.yaml -r -t yaml -o ./bundle.yaml" + run: "swagger-cli bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 88cfb4a8..eedf0e8a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,14 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - run: npm i -g @apidevtools/swagger-cli@4 - name: Bundle yaml spec - uses: mpetrunic/swagger-cli-action@v1.0.0 - with: - command: "bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml" + run: "swagger-cli bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml" - name: Bundle json spec - uses: mpetrunic/swagger-cli-action@v1.0.0 - with: - command: "bundle ./beacon-node-oapi.yaml -r -t json -o ./deploy/beacon-node-oapi.json" + run: "swagger-cli bundle ./beacon-node-oapi.yaml -r -t json -o ./deploy/beacon-node-oapi.json" - name: Create Release id: create_release uses: actions/create-release@v1 From 2654fa5c0c43e8fab36cf915ac580a5211875c33 Mon Sep 17 00:00:00 2001 From: Marin Date: Fri, 4 Feb 2022 15:13:36 +0100 Subject: [PATCH 2/3] fix spec --- .spectral.yml | 1 + params/index.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.spectral.yml b/.spectral.yml index e60e7861..96ba4afc 100644 --- a/.spectral.yml +++ b/.spectral.yml @@ -1,6 +1,7 @@ extends: [["spectral:oas", "all"]] formats: ["oas3"] rules: + operation-default-response: off operation-singular-tag: off oas3-parameter-description: off contact-properties: off diff --git a/params/index.yaml b/params/index.yaml index 202b3dd0..9d04ee48 100644 --- a/params/index.yaml +++ b/params/index.yaml @@ -1,7 +1,7 @@ StateId: + required: true name: state_id in: path - required: true example: "head" schema: type: string @@ -9,9 +9,9 @@ StateId: State identifier. Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \, \. BlockId: + required: true name: block_id in: path - required: true example: "head" schema: type: string From bb0926f9233270bd10776edf8fb48eeecf41ae7a Mon Sep 17 00:00:00 2001 From: Marin Date: Fri, 4 Feb 2022 15:19:24 +0100 Subject: [PATCH 3/3] ensure correct tool versions --- .github/workflows/main.yml | 3 ++- .spectral.yml | 1 - README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc971296..05d40f31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - - run: npm i -g @apidevtools/swagger-cli@4 @stoplight/spectral-cli@6 + - run: npm i -g @apidevtools/swagger-cli@4 @stoplight/spectral-cli@6.2.0 + - run: spectral --version - name: Lint spec run: spectral lint ./beacon-node-oapi.yaml diff --git a/.spectral.yml b/.spectral.yml index 96ba4afc..e60e7861 100644 --- a/.spectral.yml +++ b/.spectral.yml @@ -1,7 +1,6 @@ extends: [["spectral:oas", "all"]] formats: ["oas3"] rules: - operation-default-response: off operation-singular-tag: off oas3-parameter-description: off contact-properties: off diff --git a/README.md b/README.md index 7fa177b1..22ab285a 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ Api spec is checked for lint errors before merge. To run lint locally, install linter with ``` -npm install -g @stoplight/spectral +npm install -g @stoplight/spectral-cli@6.2.1 # OR -yarn global add @stoplight/spectral +yarn global add @stoplight/spectral-cli@6.2.1 ``` and run lint with ```