Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions send-slack-notification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
```

Expand Down Expand Up @@ -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`)

Expand Down
8 changes: 7 additions & 1 deletion send-slack-notification/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down