From e1a8f3df14c5396bf3ad79ce133929a8c1c1aae9 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:23:37 +0100 Subject: [PATCH 01/20] Add spectral rules and validation --- .../workflows/required-spec-validations.yml | 2 +- .github/workflows/spectral-lint.yml | 31 +++++++++++++++++++ .../spectral/.spectral.yaml | 31 ++++++++++++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/spectral-lint.yml rename .spectral.yaml => tools/spectral/.spectral.yaml (88%) diff --git a/.github/workflows/required-spec-validations.yml b/.github/workflows/required-spec-validations.yml index c26baa8833..5ff9068a6d 100644 --- a/.github/workflows/required-spec-validations.yml +++ b/.github/workflows/required-spec-validations.yml @@ -33,7 +33,7 @@ jobs: id: spectral-validation env: SPECTRAL_VERSION: ${{ inputs.spectral_version }} - run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi-foas.yaml --ruleset=.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 + run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi-foas.yaml --ruleset=spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 - name: Install Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 with: diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml new file mode 100644 index 0000000000..26453ce6dd --- /dev/null +++ b/.github/workflows/spectral-lint.yml @@ -0,0 +1,31 @@ +name: Spectral Lint + +# Trigger the workflow on pull requests and pushes to the main branch +on: + pull_request: + push: + branches: + - main + +jobs: + spectral-lint: + runs-on: ubuntu-latest + + steps: + # Checkout the code + - name: Checkout code + uses: actions/checkout@v3 + + # Set up Node.js (if you are using the npm-installed version) + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' # or any other version that fits your project + + # Install dependencies (Spectral) + - name: Install dependencies + run: npm install + + # Run Spectral lint on your OpenAPI files + - name: Run Spectral Lint + run: npx spectral lint openapi/v2.yaml diff --git a/.spectral.yaml b/tools/spectral/.spectral.yaml similarity index 88% rename from .spectral.yaml rename to tools/spectral/.spectral.yaml index a646867161..a5676632e3 100644 --- a/.spectral.yaml +++ b/tools/spectral/.spectral.yaml @@ -155,7 +155,36 @@ rules: function: pattern functionOptions: match: "^(dev|qa|stage|prod)(,(dev|qa|stage|prod))*$" - + + x-xgen-soa-migration-extension: + description: "Ensure the x-xgen-soa-migration extension is valid." + message: "The x-xgen-soa-migration extension must include 'service_name', 'allow_diff', and 'source_service' should only be present when 'allow_diff' is true." + formats: ["oas3"] + given: "$.paths[*][*].x-xgen-soa-migration" + severity: error + then: + - field: service_name + function: truthy + message: "'service_name' must be provided." + - field: allow_diff + function: pattern + functionOptions: + match: "^(true|false)$" + message: "'allow_diff' must be true or false." + - function: falsy + field: source_service + functionOptions: + type: "truthy" + message: "'source_service' should only exist when 'allow_diff' is true." + when: + field: allow_diff + pattern: "^false$" + - function: truthy + field: source_service + message: "'source_service' must be provided when 'allow_diff' is true." + when: + field: allow_diff + pattern: "^true$" overrides: - files: # load sample data has an issue with different path param names for different VERBS - "*.yaml#/paths/~1api~1atlas~1v1.0~1groups~1%7BgroupId%7D~1sampleDatasetLoad~1%7BsampleDatasetId%7D" From ff8288ef6d098bbe6741769de310e99664abf8f8 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:28:25 +0100 Subject: [PATCH 02/20] Update --- .github/workflows/spectral-lint.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 26453ce6dd..b6d771355b 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -6,6 +6,12 @@ on: push: branches: - main + workflow_dispatch: + inputs: + spectral_version: + description: 'Version of Spectral to use' + type: string + required: true jobs: spectral-lint: @@ -13,19 +19,12 @@ jobs: steps: # Checkout the code - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - # Set up Node.js (if you are using the npm-installed version) - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' # or any other version that fits your project + - name: Run + id: spectral-validation + env: + SPECTRAL_VERSION: ${{ inputs.spectral_version }} + run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi/v2.yaml --ruleset=spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 - # Install dependencies (Spectral) - - name: Install dependencies - run: npm install - - # Run Spectral lint on your OpenAPI files - - name: Run Spectral Lint - run: npx spectral lint openapi/v2.yaml From ed50787807544a5183b29a45e0a3613fa5cd7daf Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:30:33 +0100 Subject: [PATCH 03/20] Update --- .github/workflows/required-spec-validations.yml | 2 +- .github/workflows/spectral-lint.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/required-spec-validations.yml b/.github/workflows/required-spec-validations.yml index 5ff9068a6d..9a19aba4f9 100644 --- a/.github/workflows/required-spec-validations.yml +++ b/.github/workflows/required-spec-validations.yml @@ -33,7 +33,7 @@ jobs: id: spectral-validation env: SPECTRAL_VERSION: ${{ inputs.spectral_version }} - run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi-foas.yaml --ruleset=spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 + run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi-foas.yaml --ruleset=tools/spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 - name: Install Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 with: diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index b6d771355b..8685a3c6ab 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -1,4 +1,4 @@ -name: Spectral Lint +name: Spectral Lint Commited OpenAPI Spec # Trigger the workflow on pull requests and pushes to the main branch on: @@ -26,5 +26,5 @@ jobs: id: spectral-validation env: SPECTRAL_VERSION: ${{ inputs.spectral_version }} - run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi/v2.yaml --ruleset=spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 + run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi/v2.yaml --ruleset=tools/spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 From 413731fdc1f713ad1bbea92f2a8ddd4b8b8b1f79 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:41:43 +0100 Subject: [PATCH 04/20] test --- .github/workflows/spectral-lint.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 8685a3c6ab..a97004efc1 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -6,12 +6,12 @@ on: push: branches: - main - workflow_dispatch: - inputs: - spectral_version: - description: 'Version of Spectral to use' - type: string - required: true + workflow_call: + inputs: + spectral_version: + description: 'Version of Spectral to use' + type: string + required: true jobs: spectral-lint: From a894c692a8c4c429e5f657c8568afa6200ecd856 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:45:24 +0100 Subject: [PATCH 05/20] try vars --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index a97004efc1..f616a8f9b9 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -25,6 +25,6 @@ jobs: - name: Run id: spectral-validation env: - SPECTRAL_VERSION: ${{ inputs.spectral_version }} + SPECTRAL_VERSION: ${{ vars.SPECTRAL_VERSION }} run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi/v2.yaml --ruleset=tools/spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 From bea61da1f4a919d594867b53ccc18b81c79eb2f1 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:46:08 +0100 Subject: [PATCH 06/20] Update --- .github/workflows/spectral-lint.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index f616a8f9b9..ca9e1da15c 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -6,12 +6,6 @@ on: push: branches: - main - workflow_call: - inputs: - spectral_version: - description: 'Version of Spectral to use' - type: string - required: true jobs: spectral-lint: From 6e1df19e72b74187ad250df3bd9cac480eef8eb6 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 11:59:21 +0100 Subject: [PATCH 07/20] update --- tools/spectral/.spectral.yaml | 7 +++---- tools/spectral/Makefile | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 tools/spectral/Makefile diff --git a/tools/spectral/.spectral.yaml b/tools/spectral/.spectral.yaml index a5676632e3..eb4614f05b 100644 --- a/tools/spectral/.spectral.yaml +++ b/tools/spectral/.spectral.yaml @@ -156,7 +156,7 @@ rules: functionOptions: match: "^(dev|qa|stage|prod)(,(dev|qa|stage|prod))*$" - x-xgen-soa-migration-extension: + soa-migration-extension: description: "Ensure the x-xgen-soa-migration extension is valid." message: "The x-xgen-soa-migration extension must include 'service_name', 'allow_diff', and 'source_service' should only be present when 'allow_diff' is true." formats: ["oas3"] @@ -173,9 +173,7 @@ rules: message: "'allow_diff' must be true or false." - function: falsy field: source_service - functionOptions: - type: "truthy" - message: "'source_service' should only exist when 'allow_diff' is true." + message: "'source_service' should not exist when 'allow_diff' is false." when: field: allow_diff pattern: "^false$" @@ -185,6 +183,7 @@ rules: when: field: allow_diff pattern: "^true$" + overrides: - files: # load sample data has an issue with different path param names for different VERBS - "*.yaml#/paths/~1api~1atlas~1v1.0~1groups~1%7BgroupId%7D~1sampleDatasetLoad~1%7BsampleDatasetId%7D" diff --git a/tools/spectral/Makefile b/tools/spectral/Makefile new file mode 100644 index 0000000000..e1483b4654 --- /dev/null +++ b/tools/spectral/Makefile @@ -0,0 +1,32 @@ +# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html + +SPECTRAL_VERSION=6.11.1 + +.PHONY: deps +deps: ## Download go module dependencies + @echo "==> Installing npx..." + npm install -g npx + + +.PHONY: devtools +devtools: ## Install dev tools + @echo "==> Installing dev tools..." + npm install -g @stoplight/spectral-cli@"${SPECTRAL_VERSION}" + +.PHONY: setup +setup: deps devtools ## Set up dev env + +.PHONY: linterr +linterr: ## Run spectral linter on foas + @echo "==> Running spectral linter" + npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ../../openapi/v2.yaml --ruleset=.spectral.yaml --display-only-failures + +.PHONY: lintwarn +lintwarn: ## Run spectral linter on foas + @echo "==> Running spectral linter" + npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ../../openapi/v2.yaml --ruleset=.spectral.yaml --fail-severity=warn + +.PHONY: help +.DEFAULT_GOAL := help +help: + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' From da2d6500bdf055eec1ce52cffab22ae2e81d52e5 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:00:37 +0100 Subject: [PATCH 08/20] Use make --- .github/workflows/spectral-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index ca9e1da15c..3c5a745c96 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -20,5 +20,5 @@ jobs: id: spectral-validation env: SPECTRAL_VERSION: ${{ vars.SPECTRAL_VERSION }} - run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi/v2.yaml --ruleset=tools/spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 - + working-directory: tools/spectral + run: make linterr From ca0c1d0589c57bf9466b2716aebc4e573180ef7f Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:03:52 +0100 Subject: [PATCH 09/20] Add path filter --- .github/workflows/spectral-lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 3c5a745c96..b61323416b 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -3,6 +3,9 @@ name: Spectral Lint Commited OpenAPI Spec # Trigger the workflow on pull requests and pushes to the main branch on: pull_request: + paths: + - 'tools/spectral/**' + - 'openapi/**.yaml' push: branches: - main From 2c84c75e9e3e9aaa249d06545b61b8d345a9b365 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:05:17 +0100 Subject: [PATCH 10/20] Keep warnings --- tools/spectral/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/spectral/Makefile b/tools/spectral/Makefile index e1483b4654..9e97fd2d44 100644 --- a/tools/spectral/Makefile +++ b/tools/spectral/Makefile @@ -19,7 +19,7 @@ setup: deps devtools ## Set up dev env .PHONY: linterr linterr: ## Run spectral linter on foas @echo "==> Running spectral linter" - npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ../../openapi/v2.yaml --ruleset=.spectral.yaml --display-only-failures + npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ../../openapi/v2.yaml --ruleset=.spectral.yaml .PHONY: lintwarn lintwarn: ## Run spectral linter on foas From 0012b266a16437a03f95be71bbf48f49f55a44b0 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:06:27 +0100 Subject: [PATCH 11/20] adderss comment --- tools/spectral/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/spectral/Makefile b/tools/spectral/Makefile index 9e97fd2d44..55f663e3dc 100644 --- a/tools/spectral/Makefile +++ b/tools/spectral/Makefile @@ -1,6 +1,6 @@ # A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html -SPECTRAL_VERSION=6.11.1 +SPECTRAL_VERSION=${SPECTRAL_VERSION:-6.11.1} .PHONY: deps deps: ## Download go module dependencies From 72ee80ca0fc8044d13750893e96013e2c8da2aea Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:22:54 +0100 Subject: [PATCH 12/20] Update --- .github/workflows/required-spec-validations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/required-spec-validations.yml b/.github/workflows/required-spec-validations.yml index 9a19aba4f9..b56d8932e7 100644 --- a/.github/workflows/required-spec-validations.yml +++ b/.github/workflows/required-spec-validations.yml @@ -33,7 +33,7 @@ jobs: id: spectral-validation env: SPECTRAL_VERSION: ${{ inputs.spectral_version }} - run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi-foas.yaml --ruleset=tools/spectral/.spectral.yaml # we will update this to lint the FOAS in CLOUDP-263186 + run: npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint openapi-foas.yaml --ruleset=tools/spectral/.spectral.yaml - name: Install Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 with: From 77beca9ca6e2c5cf73cad618d186968932ec1389 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:34:55 +0100 Subject: [PATCH 13/20] test action --- .github/workflows/spectral-lint.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index b61323416b..368f1c4cb9 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -6,9 +6,14 @@ on: paths: - 'tools/spectral/**' - 'openapi/**.yaml' + - '.spectral.yaml' push: branches: - main + paths: + - 'tools/spectral/**' + - 'openapi/**.yaml' + - '.spectral.yaml' jobs: spectral-lint: @@ -18,10 +23,19 @@ jobs: # Checkout the code - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - - name: Run - id: spectral-validation - env: - SPECTRAL_VERSION: ${{ vars.SPECTRAL_VERSION }} - working-directory: tools/spectral - run: make linterr + with: + sparse-checkout: + openapi/ + tools/spectral + - name: Spectral action + uses: stoplightio/spectral-action@latest + with: + # Path to the OpenAPI spec files and openapi/v2.yaml + file_glob: '{openapi/**/*.yaml,openapi/v2.yaml}' + ruleset: tools/spectral/.spectral.yaml; + # - name: Run + # id: spectral-validation + # env: + # SPECTRAL_VERSION: ${{ vars.SPECTRAL_VERSION }} + # working-directory: tools/spectral + # run: make linterr From cf22d13bc5f1e2c3384abae4c9d9b1168201217a Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:35:53 +0100 Subject: [PATCH 14/20] Update --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 368f1c4cb9..d20ecc58ad 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -32,7 +32,7 @@ jobs: with: # Path to the OpenAPI spec files and openapi/v2.yaml file_glob: '{openapi/**/*.yaml,openapi/v2.yaml}' - ruleset: tools/spectral/.spectral.yaml; + spectral_ruleset: tools/spectral/.spectral.yaml; # - name: Run # id: spectral-validation # env: From 392d28ebe7614a88470faed39286bf02170f07dd Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:36:58 +0100 Subject: [PATCH 15/20] fix typo --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index d20ecc58ad..59d4c40df1 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -32,7 +32,7 @@ jobs: with: # Path to the OpenAPI spec files and openapi/v2.yaml file_glob: '{openapi/**/*.yaml,openapi/v2.yaml}' - spectral_ruleset: tools/spectral/.spectral.yaml; + spectral_ruleset: tools/spectral/.spectral.yaml # - name: Run # id: spectral-validation # env: From dd609e7c779c7e5f24cf0f135a4eb9b191a5e66c Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:39:09 +0100 Subject: [PATCH 16/20] update --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 59d4c40df1..20232c7a5c 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -32,7 +32,7 @@ jobs: with: # Path to the OpenAPI spec files and openapi/v2.yaml file_glob: '{openapi/**/*.yaml,openapi/v2.yaml}' - spectral_ruleset: tools/spectral/.spectral.yaml + spectral_ruleset: openapi/tools/spectral/.spectral.yaml # - name: Run # id: spectral-validation # env: From 78cf407af39f8ec013a0a42776acc3549bf2bc8e Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:42:41 +0100 Subject: [PATCH 17/20] update --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 20232c7a5c..3bc4cb880f 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -24,7 +24,7 @@ jobs: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: - sparse-checkout: + sparse-checkout: | openapi/ tools/spectral - name: Spectral action From 544f85a941b90589a1ec9d1f7652637d673ead4f Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:45:31 +0100 Subject: [PATCH 18/20] update --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 3bc4cb880f..4c78663309 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -32,7 +32,7 @@ jobs: with: # Path to the OpenAPI spec files and openapi/v2.yaml file_glob: '{openapi/**/*.yaml,openapi/v2.yaml}' - spectral_ruleset: openapi/tools/spectral/.spectral.yaml + spectral_ruleset: tools/spectral/.spectral.yaml # - name: Run # id: spectral-validation # env: From 5d77dddcaa15a0b8f6caa8a835bcd6bf270e5893 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Wed, 4 Sep 2024 12:49:22 +0100 Subject: [PATCH 19/20] Update --- .github/workflows/spectral-lint.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 4c78663309..7877a30cfa 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -31,11 +31,5 @@ jobs: uses: stoplightio/spectral-action@latest with: # Path to the OpenAPI spec files and openapi/v2.yaml - file_glob: '{openapi/**/*.yaml,openapi/v2.yaml}' + file_glob: openapi/v2.yaml spectral_ruleset: tools/spectral/.spectral.yaml - # - name: Run - # id: spectral-validation - # env: - # SPECTRAL_VERSION: ${{ vars.SPECTRAL_VERSION }} - # working-directory: tools/spectral - # run: make linterr From 0bc668ce01b17cbc1d80ddcf621ff06a497cc4cf Mon Sep 17 00:00:00 2001 From: Bianca Lisle <40155621+blva@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:25:18 +0100 Subject: [PATCH 20/20] Update .github/workflows/spectral-lint.yml Co-authored-by: Andrea Angiolillo --- .github/workflows/spectral-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spectral-lint.yml b/.github/workflows/spectral-lint.yml index 7877a30cfa..fc8d95b51c 100644 --- a/.github/workflows/spectral-lint.yml +++ b/.github/workflows/spectral-lint.yml @@ -28,7 +28,7 @@ jobs: openapi/ tools/spectral - name: Spectral action - uses: stoplightio/spectral-action@latest + uses: stoplightio/spectral-action@2ad0b9302e32a77c1caccf474a9b2191a8060d83 with: # Path to the OpenAPI spec files and openapi/v2.yaml file_glob: openapi/v2.yaml