diff --git a/send-slack-notification/README.md b/send-slack-notification/README.md index 6e432c4..27031d8 100644 --- a/send-slack-notification/README.md +++ b/send-slack-notification/README.md @@ -28,6 +28,7 @@ jobs: build-result: ${{ needs.job_1.result }} publish-helm-chart-result: ${{ needs.job_3.result }} publish-manifests-result: ${{ needs.job_2.result }} + generate-provenance-result: ${{ needs.job_4.result }} slack-token: ${{ secrets.MY_SECRET }} ``` @@ -65,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`) +- `generate-provenance-result` (optional, e.g. `failure`) - `message-subject` (optional, defaults to `github.workflow` for `container-image-build` and `github.repository` for `integration-test`) diff --git a/send-slack-notification/action.yaml b/send-slack-notification/action.yaml index 6e0a35e..90323c0 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" + generate-provenance-result: + description: The result of the generate provenance job (if any) + default: "N/A" test-result: description: The result of an integration test test-health: @@ -37,6 +40,7 @@ runs: PUBLISH_MANIFESTS_RESULT: ${{ inputs.publish-manifests-result }} PUBLISH_HELM_CHART_RESULT: ${{ inputs.publish-helm-chart-result }} + GENERATE_PROVENANCE_RESULT: ${{ inputs.generate-provenance-result }} BUILD_RESULT: ${{ inputs.build-result }} FAILED_TESTS: ${{ inputs.failed-tests }} @@ -55,6 +59,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 "GENERATE_PROVENANCE_RESULT=$GENERATE_PROVENANCE_RESULT" | tee -a "$GITHUB_OUTPUT" echo "BUILD_RESULT=$BUILD_RESULT" | tee -a "$GITHUB_OUTPUT" elif [ "$NOTIFICATION_TYPE" == "integration-test" ]; then [ -z "${TEST_RESULT:-}" ] && echo "The test-result input must be provided" && exit 1 @@ -89,6 +94,7 @@ runs: env: PUBLISH_MANIFESTS_RESULT: ${{ steps.valid_inputs.outputs.PUBLISH_MANIFESTS_RESULT }} PUBLISH_HELM_CHART_RESULT: ${{ steps.valid_inputs.outputs.PUBLISH_HELM_CHART_RESULT }} + GENERATE_PROVENANCE_RESULT: ${{ steps.valid_inputs.outputs.GENERATE_PROVENANCE_RESULT }} BUILD_RESULT: ${{ steps.valid_inputs.outputs.BUILD_RESULT }} FAILED_TESTS: ${{ steps.valid_inputs.outputs.FAILED_TESTS }} TEST_HEALTH: ${{ steps.valid_inputs.outputs.TEST_HEALTH }} @@ -113,7 +119,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" ] || [ "$GENERATE_PROVENANCE_RESULT" = "failure" ] || [ "$BUILD_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..7dfc9f5 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: Generate Provenance + short: true + value: "${GENERATE_PROVENANCE_RESULT}" actions: - type: button text: Go to workflow run