Skip to content

Commit e407989

Browse files
GHA-208 Summarize_release use only needs.*.result (#112)
1 parent e27787b commit e407989

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/automated-release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ jobs:
694694
name: Release Results
695695
runs-on: ${{ inputs.runner-environment }}
696696
if: always()
697+
# NOTE: When adding a job to the needs list below, also add its result
698+
# to the RESULT_* env vars in the "Post Summary to Workflow" step.
697699
needs: [ check-releasability, prepare-release, publish-github-release, create-release-ticket, release-in-jira, create-integration-tickets, update-analyzers ]
698700
env:
699701
RELEASE_PROCESS: ${{ inputs.release-process != '' && inputs.release-process || 'https://xtranet-sonarsource.atlassian.net/wiki/spaces/CSD/pages/4325048388/Release+Instructions+-+Cloud+Security' }}
@@ -710,8 +712,21 @@ jobs:
710712
SQC_TICKET_URL: ${{ needs.create-integration-tickets.outputs.sqc-ticket-url || 'not created' }}
711713
SQS_PR_URL: ${{ needs.update-analyzers.outputs.sqs-pull-request-url || 'not created' }}
712714
SQC_PR_URL: ${{ needs.update-analyzers.outputs.sqc-pull-request-url || 'not created' }}
715+
RESULT_CHECK_RELEASABILITY: ${{ needs.check-releasability.result }}
716+
RESULT_PREPARE_RELEASE: ${{ needs.prepare-release.result }}
717+
RESULT_PUBLISH_GITHUB_RELEASE: ${{ needs.publish-github-release.result }}
718+
RESULT_CREATE_RELEASE_TICKET: ${{ needs.create-release-ticket.result }}
719+
RESULT_RELEASE_IN_JIRA: ${{ needs.release-in-jira.result }}
720+
RESULT_CREATE_INTEGRATION_TICKETS: ${{ needs.create-integration-tickets.result }}
721+
RESULT_UPDATE_ANALYZERS: ${{ needs.update-analyzers.result }}
713722
run: |
714-
ALL_SUCCESS=$(echo '${{ toJson(needs) }}' | jq -r 'to_entries | all(.value.result == "success" or .value.result == "skipped")')
723+
ALL_SUCCESS=true
724+
for result in "$RESULT_CHECK_RELEASABILITY" "$RESULT_PREPARE_RELEASE" "$RESULT_PUBLISH_GITHUB_RELEASE" "$RESULT_CREATE_RELEASE_TICKET" "$RESULT_RELEASE_IN_JIRA" "$RESULT_CREATE_INTEGRATION_TICKETS" "$RESULT_UPDATE_ANALYZERS"; do
725+
if [[ "$result" != "success" && "$result" != "skipped" ]]; then
726+
ALL_SUCCESS=false
727+
break
728+
fi
729+
done
715730
716731
if [[ "$ALL_SUCCESS" == "true" ]]; then
717732
echo "# 🎉 Release Successful" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)