From 40f362511b627c23dc18c2bd5bd7e3585c40f823 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 5 Apr 2024 09:26:08 +0000 Subject: [PATCH] Run CI alert steps only on main (#797) Part of https://www.notion.so/Alerting-for-failing-CI-jobs-d0183b65453947aeab11dbddf989d9c0 - Run CI alert steps only on main to avoid alerts for in-progress PRs - The Slack alerts will be sent on a CI job failure if - A commit is pushed directly to main - A PR gets merged into main - A scheduled job runs on main Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/797 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- .gitea/workflows/fixturenet-eth-plugeth-arm-test.yml | 4 ++-- .gitea/workflows/fixturenet-eth-plugeth-test.yml | 4 ++-- .gitea/workflows/fixturenet-eth-test.yml | 4 ++-- .gitea/workflows/fixturenet-laconicd-test.yml | 4 ++-- .gitea/workflows/lint.yml | 4 ++-- .gitea/workflows/publish.yml | 4 ++-- .gitea/workflows/test-container-registry.yml | 4 ++-- .gitea/workflows/test-database.yml | 4 ++-- .gitea/workflows/test-deploy.yml | 4 ++-- .gitea/workflows/test-k8s-deploy.yml | 4 ++-- .gitea/workflows/test-webapp.yml | 4 ++-- .gitea/workflows/test.yml | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml b/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml index 9f12854d..b5e8d22c 100644 --- a/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml +++ b/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml @@ -44,7 +44,7 @@ jobs: - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth-plugeth/run-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -52,7 +52,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/fixturenet-eth-plugeth-test.yml b/.gitea/workflows/fixturenet-eth-plugeth-test.yml index 8bb4ff8d..f9db5e86 100644 --- a/.gitea/workflows/fixturenet-eth-plugeth-test.yml +++ b/.gitea/workflows/fixturenet-eth-plugeth-test.yml @@ -48,7 +48,7 @@ jobs: - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth-plugeth/run-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -56,7 +56,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/fixturenet-eth-test.yml b/.gitea/workflows/fixturenet-eth-test.yml index e5f7a24f..671184a9 100644 --- a/.gitea/workflows/fixturenet-eth-test.yml +++ b/.gitea/workflows/fixturenet-eth-test.yml @@ -46,7 +46,7 @@ jobs: - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth/run-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -54,7 +54,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/fixturenet-laconicd-test.yml b/.gitea/workflows/fixturenet-laconicd-test.yml index 50012b1d..ae5bf2d5 100644 --- a/.gitea/workflows/fixturenet-laconicd-test.yml +++ b/.gitea/workflows/fixturenet-laconicd-test.yml @@ -49,7 +49,7 @@ jobs: - name: "Run laconic CLI tests" run: ./tests/fixturenet-laconicd/run-cli-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -57,7 +57,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index d7011b46..44156eae 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: - name : "Run flake8" uses: py-actions/flake8@v2 - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -28,7 +28,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 53bce1c2..13b94ba5 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -55,7 +55,7 @@ jobs: draft: ${{ endsWith('publish-test', github.ref ) }} files: ./laconic-so - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -63,7 +63,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/test-container-registry.yml b/.gitea/workflows/test-container-registry.yml index 5cc1a0cc..f0cfb74c 100644 --- a/.gitea/workflows/test-container-registry.yml +++ b/.gitea/workflows/test-container-registry.yml @@ -52,7 +52,7 @@ jobs: join_cgroup ./tests/container-registry/run-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -60,7 +60,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/test-database.yml b/.gitea/workflows/test-database.yml index 247ed933..f66b1b77 100644 --- a/.gitea/workflows/test-database.yml +++ b/.gitea/workflows/test-database.yml @@ -50,7 +50,7 @@ jobs: join_cgroup ./tests/database/run-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -58,7 +58,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/test-deploy.yml b/.gitea/workflows/test-deploy.yml index 8d901daf..426b629b 100644 --- a/.gitea/workflows/test-deploy.yml +++ b/.gitea/workflows/test-deploy.yml @@ -48,7 +48,7 @@ jobs: - name: "Run deploy tests" run: ./tests/deploy/run-deploy-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -56,7 +56,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/test-k8s-deploy.yml b/.gitea/workflows/test-k8s-deploy.yml index fa95608c..de96b391 100644 --- a/.gitea/workflows/test-k8s-deploy.yml +++ b/.gitea/workflows/test-k8s-deploy.yml @@ -52,7 +52,7 @@ jobs: join_cgroup ./tests/k8s-deploy/run-deploy-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -60,7 +60,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/test-webapp.yml b/.gitea/workflows/test-webapp.yml index 6a3b1c94..708c6b3d 100644 --- a/.gitea/workflows/test-webapp.yml +++ b/.gitea/workflows/test-webapp.yml @@ -50,7 +50,7 @@ jobs: - name: "Run webapp tests" run: ./tests/webapp-test/run-webapp-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -58,7 +58,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 9b6e843e..f017dc49 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -48,7 +48,7 @@ jobs: - name: "Run smoke tests" run: ./tests/smoke-test/run-smoke-test.sh - name: Notify Vulcanize Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }} @@ -56,7 +56,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} - name: Notify DeepStack Slack on CI failure - if: always() + if: ${{ always() && github.ref_name == 'main' }} uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }}