Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/optional-spec-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,14 +13,29 @@ 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:
- staging
- production

permissions:
contents: write
issues: write
id-token: write

jobs:
jobs:
optional-validations:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -53,6 +68,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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main change. Workflows are not available on env based branches.

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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down