From 534a7b3cc2cc592a9e37a510b3e4541316d20c57 Mon Sep 17 00:00:00 2001 From: Volodymyr Kravets Date: Fri, 31 Jan 2025 11:49:23 +0200 Subject: [PATCH 1/2] build(slack-notification): Fix rit GH workflow to not send slack notification with empty token --- .github/workflows/rit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index 4f74035126..5a5275d94f 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -134,11 +134,11 @@ jobs: repo-owner: ${{ env.REPO_OWNER }} - name: Send Slack Notification on Success - if: success() && github.event.pull_request.head.repo.owner.login == 'rsksmart' uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 env: SLACK_BOT_TOKEN: ${{ secrets.GHA_SLACK_NOTIFICATION_TOKEN }} GITHUB_EVENT_PULL_REQUEST_HTML_URL: ${{ github.event.pull_request.html_url }} + if: ${{ success() && github.event.pull_request.head.repo.owner.login == 'rsksmart' && env.SLACK_BOT_TOKEN != '' }} with: channel-id: ${{ vars.GHA_SLACK_NOTIFICATION_CHANNEL }} payload: | From b83c09b0b0e92a007b1f4e0abe49eb6722e70b15 Mon Sep 17 00:00:00 2001 From: Volodymyr Kravets Date: Fri, 31 Jan 2025 14:41:43 +0200 Subject: [PATCH 2/2] build(slack-notification): apply new condition to failure scenario too --- .github/workflows/rit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index 5a5275d94f..ce2247c50c 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -152,11 +152,11 @@ jobs: } - name: Send Slack Notification on Failure - if: failure() && github.event.pull_request.head.repo.owner.login == 'rsksmart' uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 env: SLACK_BOT_TOKEN: ${{ secrets.GHA_SLACK_NOTIFICATION_TOKEN }} GITHUB_EVENT_PULL_REQUEST_HTML_URL: ${{ github.event.pull_request.html_url }} + if: ${{ failure() && github.event.pull_request.head.repo.owner.login == 'rsksmart' && env.SLACK_BOT_TOKEN != '' }} with: channel-id: ${{ vars.GHA_SLACK_NOTIFICATION_CHANNEL }} payload: |