Skip to content

Commit

Permalink
Merge pull request #574 from rstudio/add-failure-notifications-for-ot…
Browse files Browse the repository at this point in the history
…her-actions

Add notifications for failing gha for all workflows
  • Loading branch information
jforest authored Oct 9, 2024
2 parents ee14f2d + 9df5036 commit def8239
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/chart-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack of chart documentation failure
if: failure()
uses: slackapi/[email protected]
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
Expand Down Expand Up @@ -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/[email protected]
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
21 changes: 21 additions & 0 deletions .github/workflows/chart-rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
21 changes: 21 additions & 0 deletions .github/workflows/chart-releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,24 @@ jobs:
charts_repo_url: https://helm.rstudio.com
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Notify Slack of chart release failure
if: failure()
uses: slackapi/[email protected]
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
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,23 @@ jobs:

- run: just push-docs

- name: Notify Slack of publishing chart documentation failure
if: failure()
uses: slackapi/[email protected]
with:
payload-delimiter: "_"
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Publishing 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

0 comments on commit def8239

Please sign in to comment.