Skip to content

Commit a94c535

Browse files
fix: workflow for reporting jira issues fails to trigger (#1004)
Co-authored-by: Lovisa Berggren <[email protected]>
1 parent 5b0217a commit a94c535

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

.github/workflows/optional-spec-validations.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_call:
44
inputs:
55
spectral_version:
6-
description: 'Version of Spectral to use'
6+
description: 'Version of Spectral to use'
77
type: string
88
required: true
99
env:
@@ -13,14 +13,31 @@ on:
1313
secrets: # all secrets are passed explicitly in this workflow
1414
api_bot_pat:
1515
required: true
16-
16+
jira_api_token:
17+
required: true
18+
workflow_dispatch:
19+
inputs:
20+
spectral_version:
21+
description: 'Version of Spectral to use'
22+
type: string
23+
required: true
24+
default: 'latest'
25+
env:
26+
description: 'Environment to validate the OpenAPI Spec for.'
27+
type: choice
28+
required: true
29+
options:
30+
- dev
31+
- qa
32+
- staging
33+
- prod
1734

1835
permissions:
1936
contents: write
2037
issues: write
2138
id-token: write
2239

23-
jobs:
40+
jobs:
2441
optional-validations:
2542
runs-on: ubuntu-latest
2643
steps:
@@ -53,6 +70,13 @@ jobs:
5370
make convert_to_collection
5471
npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ./tmp/collection.json --ruleset=./validation/spectral.yaml
5572
popd
73+
- name: Checkout .github folder from main branch
74+
if: ${{ failure() }}
75+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
76+
with:
77+
ref: main
78+
sparse-checkout: |
79+
.github/workflows
5680
- name: Create Issue - Postman validation Failed
5781
if: ${{ failure() && steps.spectral-validation.outcome == 'failure' }}
5882
uses: ./.github/workflows/task-failure-handler.yml

.github/workflows/release-spec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
uses: ./.github/workflows/optional-spec-validations.yml
9797
secrets:
9898
api_bot_pat: ${{ secrets.api_bot_pat }}
99+
jira_api_token: ${{ secrets.jira_api_token }}
99100
with:
100101
env: ${{ inputs.env }}
101102
spectral_version: ${{ vars.SPECTRAL_VERSION }}

0 commit comments

Comments
 (0)