Skip to content

Commit 2c59e08

Browse files
authored
chore: Sends only one notification when Terraform Compatibility Matrix fails (#2333)
* add input to test-suite.yml to chose if notifications are sent * add input in workflow_dispatch * add quotes around true * correct bools and remove schedule condition * set default false for workflow_dispatch
1 parent ba0db9f commit 2c59e08

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/terraform-compatibility-matrix.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
with:
4949
terraform_matrix: '["${{ matrix.terraform_version }}"]'
5050
atlas_cloud_env: ${{ inputs.atlas_cloud_env }}
51+
send_notification: false
5152

5253
slack-notification:
5354
needs: ["run-test-supported-versions"]

.github/workflows/test-suite.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
provider_matrix:
1111
description: 'Previous MongoDB Atlas Provider version matrix for migration tests (JSON array)'
1212
default: '[""]' # "" for latest version
13+
send_notification:
14+
description: 'Send the Slack notification if any of the tests fail.'
15+
type: boolean
16+
default: false
1317
workflow_call:
1418
inputs:
1519
terraform_matrix:
@@ -23,6 +27,10 @@ on:
2327
description: 'Atlas cloud environment used, can be either `dev` or `qa`, empty for `dev`'
2428
type: string
2529
required: false
30+
send_notification:
31+
description: 'Send the Slack notification if any of the tests fail.'
32+
type: boolean
33+
default: true
2634

2735
schedule:
2836
- cron: "0 0 2-31 * *" # workflow runs every day at midnight UTC except on the first day of the month
@@ -73,7 +81,7 @@ jobs:
7381

7482
slack-notification:
7583
needs: [tests, clean-after]
76-
if: ${{ !cancelled() && github.event_name == 'schedule' && needs.tests.result == 'failure'}}
84+
if: ${{ !cancelled() && needs.tests.result == 'failure' && inputs.send_notification == true }}
7785
runs-on: ubuntu-latest
7886
permissions: {}
7987
steps:

0 commit comments

Comments
 (0)