Skip to content

Commit 7bbfa3f

Browse files
Copilotwtrocki
andcommitted
Fix GitHub Actions workflow error by converting reusable workflow calls from steps to jobs
Co-authored-by: wtrocki <[email protected]>
1 parent 74ef254 commit 7bbfa3f

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

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

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
secrets: # all secrets are passed explicitly in this workflow
1414
api_bot_pat:
1515
required: true
16+
jira_api_token:
17+
required: true
1618

1719

1820
permissions:
@@ -23,6 +25,9 @@ permissions:
2325
jobs:
2426
optional-validations:
2527
runs-on: ubuntu-latest
28+
outputs:
29+
postman-validation-failed: ${{ steps.set-outputs.outputs.postman-validation-failed }}
30+
ipa-validation-failed: ${{ steps.set-outputs.outputs.ipa-validation-failed }}
2631
steps:
2732
- name: Checkout repository
2833
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
@@ -53,17 +58,34 @@ jobs:
5358
make convert_to_collection
5459
npx -- @stoplight/spectral-cli@"${SPECTRAL_VERSION}" lint ./tmp/collection.json --ruleset=./validation/spectral.yaml
5560
popd
56-
- name: Create Issue - Postman validation Failed
57-
if: ${{ failure() && steps.spectral-validation.outcome == 'failure' }}
58-
uses: ./.github/workflows/task-failure-handler.yml
59-
with:
60-
env: ${{ inputs.env }}
61-
task_name: 'Optional Postman validation'
62-
team_id: ${{ vars.JIRA_TEAM_ID_APIX_PLATFORM }}
63-
- name: Create Issue - IPA validation Failed
64-
if: ${{ failure() && steps.ipa-spectral-validation.outcome == 'failure'}}
65-
uses: ./.github/workflows/task-failure-handler.yml
66-
with:
67-
env: ${{ inputs.env }}
68-
task_name: 'Optional IPA validation'
69-
team_id: ${{ vars.JIRA_TEAM_ID_APIX_PLATFORM }}
61+
- name: Set outputs for error handling
62+
id: set-outputs
63+
if: always()
64+
run: |
65+
echo "postman-validation-failed=${{ steps.spectral-validation.outcome == 'failure' }}" >> $GITHUB_OUTPUT
66+
echo "ipa-validation-failed=${{ steps.ipa-spectral-validation.outcome == 'failure' }}" >> $GITHUB_OUTPUT
67+
68+
postman-validation-error-handler:
69+
name: Handle Postman Validation Error
70+
needs: optional-validations
71+
if: ${{ always() && needs.optional-validations.outputs.postman-validation-failed == 'true' }}
72+
uses: ./.github/workflows/task-failure-handler.yml
73+
with:
74+
env: ${{ inputs.env }}
75+
task_name: 'Optional Postman validation'
76+
team_id: ${{ vars.JIRA_TEAM_ID_APIX_PLATFORM }}
77+
secrets:
78+
jira_api_token: ${{ secrets.jira_api_token }}
79+
80+
ipa-validation-error-handler:
81+
name: Handle IPA Validation Error
82+
needs: optional-validations
83+
if: ${{ always() && needs.optional-validations.outputs.ipa-validation-failed == 'true' }}
84+
uses: ./.github/workflows/task-failure-handler.yml
85+
with:
86+
env: ${{ inputs.env }}
87+
task_name: 'Optional IPA validation'
88+
team_id: ${{ vars.JIRA_TEAM_ID_APIX_PLATFORM }}
89+
secrets:
90+
jira_api_token: ${{ secrets.jira_api_token }}
91+

.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)