Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/notify-slack-on-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Notify Slack on bug filed

# Posts a message to the #telemetry Slack channel whenever an issue is
# opened with — or later labeled — `bug`. Covers both manual filings
# and the `/bicameral-report-bug` skill (which files with labels
# `dev,bug` per skills/bicameral-report-bug/SKILL.md).
#
# Setup (one-time): create an incoming webhook for #telemetry on Slack,
# then add the URL as a repo secret named SLACK_TELEMETRY_WEBHOOK_URL.
# Without that secret the job is a no-op (the slack-github-action step
# fails closed; no spurious notifications).

on:
issues:
types: [opened, labeled]

permissions:
contents: read

jobs:
notify:
runs-on: ubuntu-latest
if: |
(github.event.action == 'opened' && contains(github.event.issue.labels.*.name, 'bug'))
|| (github.event.action == 'labeled' && github.event.label.name == 'bug')
steps:
- name: Post to #telemetry
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": ":lady_beetle: New bug filed: <${{ github.event.issue.html_url }}|#${{ github.event.issue.number }} ${{ github.event.issue.title }}>",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":lady_beetle: New bug — #${{ github.event.issue.number }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ github.event.issue.html_url }}|${{ github.event.issue.title }}>*"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Filed by *${{ github.event.issue.user.login }}* in `${{ github.repository }}`"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TELEMETRY_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
Loading