From 3cec258fcc29aa6a449fe69b9b53ac58d03a11a5 Mon Sep 17 00:00:00 2001 From: Felippe Burk Date: Wed, 24 May 2023 14:15:39 -0600 Subject: [PATCH 1/2] adding new slack notification on nightly workflow Signed-off-by: Felippe Burk --- .github/workflows/nightly.yml | 21 ++++++++++++++++ .github/workflows/staging.yml | 21 ++++++++++++++++ .github/workflows/templates/nightly.yml.jinja | 24 +++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cf41d2e358e..cc71ffe5bdf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2112,6 +2112,27 @@ jobs: id: get-workflow-info uses: technote-space/workflow-conclusion-action@v3 + - name: Notify Slack + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + payload: | + { + "text": "Nightly Workflow build result: ${{ job.status }}\n${{ github.event.head_commit.url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.head_commit.url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Set Pipeline Exit Status shell: bash run: | diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 7e7a492dfd4..604e4b510f9 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -2757,6 +2757,27 @@ jobs: id: get-workflow-info uses: technote-space/workflow-conclusion-action@v3 + - name: Notify Slack + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + payload: | + { + "text": "Nightly Workflow build result: ${{ job.status }}\n${{ github.event.head_commit.url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.head_commit.url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Set Pipeline Exit Status shell: bash run: | diff --git a/.github/workflows/templates/nightly.yml.jinja b/.github/workflows/templates/nightly.yml.jinja index d78faa49c0a..05a19cf5248 100644 --- a/.github/workflows/templates/nightly.yml.jinja +++ b/.github/workflows/templates/nightly.yml.jinja @@ -116,3 +116,27 @@ concurrency: tools pkg repo publish <{ gh_environment }> --salt-version=${{ needs.prepare-workflow.outputs.salt-version }} artifacts/pkgs/repo/ <%- endblock jobs %> + +<%- block set_pipeline_exit_status_extra_steps %> + + - name: Notify Slack + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + payload: | + { + "text": "Nightly Workflow build result: ${{ job.status }}\n${{ github.event.head_commit.url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.head_commit.url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK +<%- endblock set_pipeline_exit_status_extra_steps %> From bb88243ff97152077a2e539e84dabc189bb28a03 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 25 May 2023 18:38:39 +0100 Subject: [PATCH 2/2] Only notify on nightly builds Signed-off-by: Pedro Algarvio --- .github/workflows/staging.yml | 21 ------------------- .github/workflows/templates/nightly.yml.jinja | 5 +++++ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 604e4b510f9..7e7a492dfd4 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -2757,27 +2757,6 @@ jobs: id: get-workflow-info uses: technote-space/workflow-conclusion-action@v3 - - name: Notify Slack - id: slack - uses: slackapi/slack-github-action@v1.24.0 - with: - payload: | - { - "text": "Nightly Workflow build result: ${{ job.status }}\n${{ github.event.head_commit.url }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.head_commit.url }}" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - name: Set Pipeline Exit Status shell: bash run: | diff --git a/.github/workflows/templates/nightly.yml.jinja b/.github/workflows/templates/nightly.yml.jinja index 05a19cf5248..7e45a21f4f6 100644 --- a/.github/workflows/templates/nightly.yml.jinja +++ b/.github/workflows/templates/nightly.yml.jinja @@ -119,6 +119,8 @@ concurrency: <%- block set_pipeline_exit_status_extra_steps %> + <%- if workflow_slug == "nightly" %> + - name: Notify Slack id: slack uses: slackapi/slack-github-action@v1.24.0 @@ -139,4 +141,7 @@ concurrency: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + <%- endif %> + <%- endblock set_pipeline_exit_status_extra_steps %>