-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slack integration for GHA failures (build cop) #366
base: main
Are you sure you want to change the base?
Conversation
09a00f4
to
4eb53a1
Compare
4eb53a1
to
a6082b8
Compare
I've tested the functionality on a dummy repository that you can see in the example above. Unfortunately, to do any further testing on |
Previously, tyler-yankee wrote…
+@BetsyMcPhail for feature review, please! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee betsymcphail, LGTM missing from assignee nicolecheetham, platform LGTM missing (waiting on @nicolecheetham and @tyler-yankee)
a discussion (no related file):
Previously, tyler-yankee (Tyler Yankee) wrote…
+@BetsyMcPhail for feature review, please!
+@nicolecheetham can you take over feature review on this please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, mostly just a few tiny things here and there. Nice job!
Also, is there more work that needs to be done that hasn't been shown? Your last comment seems to suggest as such and I remember you mentioning needing to update the variable used for SLACK_WEBHOOK_URL.
Reviewable status: 7 unresolved discussions, LGTM missing from assignee nicolecheetham, platform LGTM missing (waiting on @tyler-yankee)
.github/workflows/slack.yml
line 11 at r1 (raw file):
jobs: notify:
nit consider renaming the job as to specify the type of notification. Maybe like notify_errors, failure_notifications, or error_notifications?
.github/workflows/slack.yml
line 14 at r1 (raw file):
runs-on: ubuntu-latest steps: - name: Notify Build Cop Slack
nit similar to the job name.
.github/workflows/slack.yml
line 15 at r1 (raw file):
steps: - name: Notify Build Cop Slack if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out'
This expression should be surrounded by ${{ }}
.github/workflows/slack.yml
line 20 at r1 (raw file):
status: ${{ github.event.workflow_run.conclusion }} notification_title: > ${{github.event.workflow_run.name}} failed on ${{github.event.workflow_run.head_branch}} -
nit I think you could replace "failed" with ${{github.event.workflow_run.conclusion}}. This would allow you to remove the message format line that says "Result: ..." simplifying the overall notification.
.github/workflows/slack.yml
line 21 at r1 (raw file):
notification_title: > ${{github.event.workflow_run.name}} failed on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>
nit The path can be simplified to ${{github.event.workflow_run.url}}
.github/workflows/slack.yml
line 25 at r1 (raw file):
Result: ${{github.event.workflow_run.conclusion}} Run: ${{github.event.workflow_run.run_number}} Branch: <${{github.server_url}}/${{github.repository}}/tree/${{github.event.workflow_run.head_branch}}|${{github.repository}}/${{github.event.workflow_run.head_branch}}>
nit Is there a way to use ravsamhq/notify-slack-action@v2 customs variables to make the branch and footer notification less verbose code wise? Like {branch_url} and {repo_url}
Addresses #22019. Adds CI workflow for a custom Slack bot in DrakeDevelopers to send a notification to the
#buildcop
channel when GitHub Actions fails.It turns out that GitHub's Slack integration doesn't support only filtering for workflow failures (see: integrations/slack#1563), which is why we're using the notify-slack-action instead.
This change is