From 3d9a8003b7149d7c342b5a94d9436c0b99b62135 Mon Sep 17 00:00:00 2001 From: Patrick Carey Date: Tue, 30 Jun 2020 11:11:56 +0100 Subject: [PATCH] Add slack notifications to workflow run (#6) * Add slack notifications to workflow run * Add explicit fail step to test notification * Remove explicit fail step --- .github/workflows/acceptance-tests.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index a7be532..16c37cf 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Wait for previous workflows to complete uses: softprops/turnstyle@v1 env: - GITHUB_TOKEN: ${{ secrets.TURNSTYLE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: poll-interval-seconds: 10 @@ -34,3 +34,22 @@ jobs: env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} CLOUDSMITH_NAMESPACE: terraform-provider-testing + + - name: Notify Slack on Success + if: success() + uses: rtCamp/action-slack-notify@v2.0.2 + env: + SLACK_ICON: https://avatars0.githubusercontent.com/u/44036562?s=200&v=4 + SLACK_TITLE: Workflow Succeeded + SLACK_USERNAME: Github Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + - name: Notify Slack on Failure + if: failure() + uses: rtCamp/action-slack-notify@v2.0.2 + env: + SLACK_COLOR: danger + SLACK_ICON: https://avatars0.githubusercontent.com/u/44036562?s=200&v=4 + SLACK_TITLE: Workflow Failed + SLACK_USERNAME: Github Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}