mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem We have accumulated several additions to workflows in GitHub Actions, but we are not notified when they failed. ## Solution This PR adds two files to notify Docs-related and KB-related failures in our Slack team alerts channel. <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions ///// ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Ali Waseem <waseema393@gmail.com>
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: Alert on master breakage
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
- 'KB E2E Tests'
|
|
- 'KB Search Ingest'
|
|
- 'KB tests'
|
|
- 'KB Troubleshooting Sync'
|
|
branches: [master]
|
|
types:
|
|
- completed
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
|
|
jobs:
|
|
notify:
|
|
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Send Slack alert
|
|
env:
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DOCS_WEBHOOK_URL }}
|
|
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
|
|
WORKFLOW_URL: ${{ github.event.workflow_run.html_url }}
|
|
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
|
|
COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
|
|
COMMIT_AUTHOR: ${{ github.event.workflow_run.head_commit.author.name }}
|
|
REPO_URL: https://github.com/${{ github.repository }}
|
|
run: |
|
|
SHORT_SHA="${COMMIT_SHA:0:7}"
|
|
FIRST_LINE=$(echo "$COMMIT_MESSAGE" | head -1)
|
|
|
|
PAYLOAD=$(jq -n \
|
|
--arg workflow_name "$WORKFLOW_NAME" \
|
|
--arg workflow_url "$WORKFLOW_URL" \
|
|
--arg commit_sha "$COMMIT_SHA" \
|
|
--arg short_sha "$SHORT_SHA" \
|
|
--arg commit_msg "$FIRST_LINE" \
|
|
--arg author "$COMMIT_AUTHOR" \
|
|
--arg repo_url "$REPO_URL" \
|
|
'{
|
|
text: ":rotating_light: \($workflow_name) failed on master",
|
|
blocks: [
|
|
{
|
|
type: "header",
|
|
text: {
|
|
type: "plain_text",
|
|
text: ":rotating_light: master is broken"
|
|
}
|
|
},
|
|
{
|
|
type: "section",
|
|
text: {
|
|
type: "mrkdwn",
|
|
text: "*Workflow:* <\($workflow_url)|\($workflow_name)>\n*Commit:* <\($repo_url)/commit/\($commit_sha)|\($short_sha)> \($commit_msg)\n*Author:* \($author)"
|
|
}
|
|
}
|
|
]
|
|
}')
|
|
|
|
curl -f -X POST "$SLACK_WEBHOOK_URL" \
|
|
-H 'Content-Type: application/json' \
|
|
-d "$PAYLOAD"
|