From 3a658b36b2f8679ddbd2f9251749407c3c1773c8 Mon Sep 17 00:00:00 2001 From: adamlahbib Date: Sat, 16 Nov 2024 20:10:04 +0100 Subject: [PATCH] Refactor sync-and-deploy.yaml to update Slack notification color based on deployment success --- .github/workflows/sync-and-deploy.yaml | 2 +- .github/workflows/test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-and-deploy.yaml b/.github/workflows/sync-and-deploy.yaml index 67af7c6..326b6f7 100644 --- a/.github/workflows/sync-and-deploy.yaml +++ b/.github/workflows/sync-and-deploy.yaml @@ -153,5 +153,5 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_USERNAME: "Deployer on Cloudflare" SLACK_MESSAGE: ${{ needs.deploy.outputs.message && needs.deploy.outputs.message || needs.terraform-apply.outputs.message }} - SLACK_COLOR: ${{ needs.deploy.outputs.message == *"successful"* && "good" || "danger" }} + SLACK_COLOR: ${{ contains(needs.deploy.outputs.message, "successful") && 'good' || 'danger' }} SLACK_ICON: "https://avatars.githubusercontent.com/u/44036562?s=200&v=4" \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3596ee5..6333f4b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -82,5 +82,5 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_USERNAME: "Test Pipeline Results" SLACK_MESSAGE: ${{ needs.test-app.outputs.message }} - SLACK_COLOR: ${{ needs.test-app.outputs.message == *"failed"* && "danger" || "good" }} + SLACK_COLOR: ${{ contains(needs.test-app.outputs.message, 'failed') && 'danger' || 'good' }} SLACK_ICON: "https://avatars.githubusercontent.com/u/44036562?s=200&v=4" \ No newline at end of file