From 91b5cc22a94c82bb49660fd2ecba39bc21874762 Mon Sep 17 00:00:00 2001 From: "Joshua C. Forest" Date: Wed, 9 Oct 2024 09:14:34 -0400 Subject: [PATCH 1/2] Add notifications for failing gha for all workflows --- .github/workflows/chart-doc.yaml | 42 +++++++++++++++++++++++++++ .github/workflows/chart-rebuild.yaml | 21 ++++++++++++++ .github/workflows/chart-releaser.yaml | 21 ++++++++++++++ .github/workflows/publish.yml | 20 +++++++++++++ 4 files changed, 104 insertions(+) diff --git a/.github/workflows/chart-doc.yaml b/.github/workflows/chart-doc.yaml index 8c934a1a..f1938270 100644 --- a/.github/workflows/chart-doc.yaml +++ b/.github/workflows/chart-doc.yaml @@ -44,6 +44,27 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Notify Slack of chart documentation failure + if: failure() + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Chart Documentation failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + rbac: runs-on: ubuntu-latest name: rbac @@ -79,3 +100,24 @@ jobs: - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Notify Slack of chart documentation (rbac) failure + if: failure() + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Chart Documentation (RBAC) failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/chart-rebuild.yaml b/.github/workflows/chart-rebuild.yaml index f399113c..54ef9185 100644 --- a/.github/workflows/chart-rebuild.yaml +++ b/.github/workflows/chart-rebuild.yaml @@ -57,3 +57,24 @@ jobs: run: | echo "Created Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + + - name: Notify Slack of index.yaml rebuild failure + if: failure() + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Rebuild of index.yaml failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/chart-releaser.yaml b/.github/workflows/chart-releaser.yaml index 9d5c1881..f26d1f7a 100644 --- a/.github/workflows/chart-releaser.yaml +++ b/.github/workflows/chart-releaser.yaml @@ -38,3 +38,24 @@ jobs: charts_repo_url: https://helm.rstudio.com env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Notify Slack of chart releaser failure + if: failure() + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Chart Release failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6e51b8e5..6da33ce6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,3 +36,23 @@ jobs: - run: just push-docs + - name: Notify Slack of publishing chart documentation failure + if: failure() + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Publish of Chart Documentation failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK From 9df503661d808a491612a6c5d6221c8d9f16b6dc Mon Sep 17 00:00:00 2001 From: "Joshua C. Forest" Date: Wed, 9 Oct 2024 09:17:43 -0400 Subject: [PATCH 2/2] better englishing --- .github/workflows/chart-releaser.yaml | 2 +- .github/workflows/publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chart-releaser.yaml b/.github/workflows/chart-releaser.yaml index f26d1f7a..f9253d18 100644 --- a/.github/workflows/chart-releaser.yaml +++ b/.github/workflows/chart-releaser.yaml @@ -39,7 +39,7 @@ jobs: env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - name: Notify Slack of chart releaser failure + - name: Notify Slack of chart release failure if: failure() uses: slackapi/slack-github-action@v1.27.0 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6da33ce6..cced9183 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,7 +48,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "Publish of Chart Documentation failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + "text": "Publishing Chart Documentation failed, please check the logs. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" } } ]