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
1820permissions :
@@ -23,6 +25,9 @@ permissions:
2325jobs :
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+
0 commit comments