diff --git a/.github/workflows/optional-spec-validations.yml b/.github/workflows/optional-spec-validations.yml index 23e9793eff..66ec2f9ab0 100644 --- a/.github/workflows/optional-spec-validations.yml +++ b/.github/workflows/optional-spec-validations.yml @@ -3,7 +3,7 @@ on: workflow_call: inputs: spectral_version: - description: 'Version of Spectral to use' + description: 'Version of Spectral to use' type: string required: true env: @@ -13,14 +13,31 @@ on: secrets: # all secrets are passed explicitly in this workflow api_bot_pat: required: true - + jira_api_token: + required: true + workflow_dispatch: + inputs: + spectral_version: + description: 'Version of Spectral to use' + type: string + required: true + default: 'latest' + env: + description: 'Environment to validate the OpenAPI Spec for.' + type: choice + required: true + options: + - dev + - qa + - staging + - prod permissions: contents: write issues: write id-token: write -jobs: +jobs: optional-validations: runs-on: ubuntu-latest steps: @@ -53,6 +70,13 @@ jobs: make convert_to_collection npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ./tmp/collection.json --ruleset=./validation/spectral.yaml popd + - name: Checkout .github folder from main branch + if: ${{ failure() }} + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + with: + ref: main + sparse-checkout: | + .github/workflows - name: Create Issue - Postman validation Failed if: ${{ failure() && steps.spectral-validation.outcome == 'failure' }} uses: ./.github/workflows/task-failure-handler.yml diff --git a/.github/workflows/release-spec.yml b/.github/workflows/release-spec.yml index 320d4a33c7..377f4ae2e7 100644 --- a/.github/workflows/release-spec.yml +++ b/.github/workflows/release-spec.yml @@ -96,6 +96,7 @@ jobs: uses: ./.github/workflows/optional-spec-validations.yml secrets: api_bot_pat: ${{ secrets.api_bot_pat }} + jira_api_token: ${{ secrets.jira_api_token }} with: env: ${{ inputs.env }} spectral_version: ${{ vars.SPECTRAL_VERSION }}