diff --git a/send-slack-notification/README.md b/send-slack-notification/README.md index ddd37ce..e27cf57 100644 --- a/send-slack-notification/README.md +++ b/send-slack-notification/README.md @@ -66,6 +66,7 @@ jobs: - `build-result` (optional, e.g. `success`) - `publish-manifests-result` (optional, e.g. `failure`) - `publish-helm-chart-result` (optional, e.g. `failure`) +- `combined-checks-result` (optional, e.g. `failure`) - `test-result` (optional, e.g. `failure`) - `test-health` (optional, comes from the `run-integration-test` action) - `failed-tests` (optional, comes from the `run-integration-test` action) diff --git a/send-slack-notification/action.yaml b/send-slack-notification/action.yaml index 5856184..acfa9f1 100644 --- a/send-slack-notification/action.yaml +++ b/send-slack-notification/action.yaml @@ -15,6 +15,9 @@ inputs: publish-helm-chart-result: description: The result of the publish helm chart job (if any) default: "N/A" + combined-checks-result: + description: The result of one ore more checks combined (if any) + default: "N/A" test-result: description: The result of an integration test test-health: @@ -39,6 +42,7 @@ runs: PUBLISH_MANIFESTS_RESULT: ${{ inputs.publish-manifests-result }} PUBLISH_HELM_CHART_RESULT: ${{ inputs.publish-helm-chart-result }} + COMBINED_CHECKS_RESULT: ${{ inputs.combined-checks-result }} BUILD_RESULT: ${{ inputs.build-result }} DASHBOARD_URL: ${{ inputs.dashboard-url }} @@ -60,6 +64,7 @@ runs: echo "PUBLISH_MANIFESTS_RESULT=$PUBLISH_MANIFESTS_RESULT" | tee -a "$GITHUB_OUTPUT" echo "PUBLISH_HELM_CHART_RESULT=$PUBLISH_HELM_CHART_RESULT" | tee -a "$GITHUB_OUTPUT" + echo "COMBINED_CHECKS_RESULT=$COMBINED_CHECKS_RESULT" | tee -a "$GITHUB_OUTPUT" echo "BUILD_RESULT=$BUILD_RESULT" | tee -a "$GITHUB_OUTPUT" elif [ "$NOTIFICATION_TYPE" == "integration-test" ]; then [ -z "${DASHBOARD_URL:-}" ] && echo "The dashboard-url input must be provided" && exit 1 @@ -105,6 +110,8 @@ runs: FAILED_TESTS: ${{ steps.valid_inputs.outputs.FAILED_TESTS }} TEST_HEALTH: ${{ steps.valid_inputs.outputs.TEST_HEALTH }} TEST_RESULT: ${{ steps.valid_inputs.outputs.TEST_RESULT }} + # Catch-all combined checks result + COMBINED_CHECKS_RESULT: ${{ steps.valid_inputs.outputs.COMBINED_CHECKS_RESULT }} # General/common values NOTIFICATION_TYPE: ${{ steps.valid_inputs.outputs.NOTIFICATION_TYPE }} GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }} @@ -129,7 +136,7 @@ runs: fi # TODO (@Techassi): Also add success template - if [ "$PUBLISH_MANIFESTS_RESULT" = "failure" ] || [ "$PUBLISH_HELM_CHART_RESULT" = "failure" ] || [ "$BUILD_RESULT" = "failure" ]; then + if [ "$PUBLISH_MANIFESTS_RESULT" = "failure" ] || [ "$PUBLISH_HELM_CHART_RESULT" = "failure" ] || [ "$BUILD_RESULT" = "failure" ] || [ "$COMBINED_CHECKS_RESULT" = "failure" ]; then export MESSAGE_VERB=failed export MESSAGE_COLOR=aa0000 else diff --git a/send-slack-notification/templates/container-image-build/failure.tpl b/send-slack-notification/templates/container-image-build/failure.tpl index 9d84451..e34293c 100644 --- a/send-slack-notification/templates/container-image-build/failure.tpl +++ b/send-slack-notification/templates/container-image-build/failure.tpl @@ -14,6 +14,9 @@ attachments: - title: Build/Publish Helm Chart short: true value: "${PUBLISH_HELM_CHART_RESULT}" + - title: Checks + short: true + value: "${COMBINED_CHECKS_RESULT}" actions: - type: button text: Go to workflow run