Skip to content
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

Add slack notification for canary build failures #42394

Merged
merged 43 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4c61239
add slack notifier
romsharon98 Sep 21, 2024
53d53a1
move step to correct workflow
romsharon98 Sep 22, 2024
9941577
fix static checks
romsharon98 Sep 24, 2024
11f1d54
move job to correct workflow with correct condition
romsharon98 Sep 24, 2024
9ebc77d
move job to correct workflow with correct condition
romsharon98 Sep 24, 2024
ffdbe03
revert build-images.yml
romsharon98 Sep 24, 2024
09c7eb8
change comment to correct slack channel
romsharon98 Sep 24, 2024
f15ce76
replace incoming webhook with slack app
romsharon98 Sep 25, 2024
23c500b
replace incoming webhook with slack app
romsharon98 Sep 25, 2024
e57d30e
change steps order to run slack step
romsharon98 Sep 25, 2024
355a4e0
change steps order to run slack step
romsharon98 Sep 25, 2024
f569e65
change steps order to run slack step
romsharon98 Sep 25, 2024
6a33313
change steps order to run slack step
romsharon98 Sep 25, 2024
302b8c4
change steps order to run slack step
romsharon98 Sep 25, 2024
a47c39f
change steps order to run slack step
romsharon98 Sep 25, 2024
982fccf
change steps order to run slack step
romsharon98 Sep 25, 2024
bbe1239
change steps order to run slack step
romsharon98 Sep 25, 2024
7a1f719
change steps order to run slack step
romsharon98 Sep 25, 2024
534027b
change steps order to run slack step
romsharon98 Sep 25, 2024
c4a45c3
change steps order to run slack step
romsharon98 Sep 25, 2024
faf13e6
change steps order to run slack step
romsharon98 Sep 25, 2024
04d7db7
change steps order to run slack step
romsharon98 Sep 25, 2024
dd4e2fb
revert build-images.yml
romsharon98 Sep 25, 2024
90f0e7b
revert build-images.yml
romsharon98 Sep 25, 2024
686cc53
revert build-images.yml
romsharon98 Sep 25, 2024
4edd962
revert build-images.yml
romsharon98 Sep 25, 2024
7d7a522
revert build-images.yml
romsharon98 Sep 25, 2024
ebd0153
revert build-images.yml
romsharon98 Sep 25, 2024
65f3b73
remove unecessary needs
romsharon98 Sep 25, 2024
db94d58
remove step from build image
romsharon98 Sep 25, 2024
4bef129
change alert
romsharon98 Sep 25, 2024
09b7cc4
remove quation mark
romsharon98 Sep 25, 2024
35fdeea
add payload
romsharon98 Sep 25, 2024
ef79877
change payload
romsharon98 Sep 25, 2024
8be08b0
remove special charts
romsharon98 Sep 25, 2024
708c9fb
change payload
romsharon98 Sep 25, 2024
9dc6b64
change payload
romsharon98 Sep 25, 2024
39000e8
add payload
romsharon98 Sep 25, 2024
df26705
add condition for failure and scheduling
romsharon98 Sep 25, 2024
f7b417f
fix static checks
romsharon98 Sep 25, 2024
6374340
done
romsharon98 Sep 25, 2024
781fd86
fix static checks
romsharon98 Sep 26, 2024
cc8c15f
remove payload-delemiter
romsharon98 Sep 27, 2024
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
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
IMAGE_TAG: "${{ github.event.pull_request.head.sha || github.sha }}"
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
VERBOSE: "true"

concurrency:
Expand Down Expand Up @@ -669,3 +670,31 @@ jobs:
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
docker-cache: ${{ needs.build-info.outputs.docker-cache }}
canary-run: ${{ needs.build-info.outputs.canary-run }}

notify-slack-failure:
name: "Notify Slack on Failure"
if: github.event_name == 'schedule' && failure()
runs-on: ["ubuntu-22.04"]
steps:
- name: Notify Slack
id: slack
uses: slackapi/slack-github-action@v1.27.0
with:
channel-id: 'zzz_webhook_test'
# yamllint disable rule:line-length
payload: |
{
"text": "🚨🕒 Scheduled CI Failure Alert 🕒🚨\n\n*Details:* <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View the failure log>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "🚨🕒 Scheduled CI Failure Alert 🕒🚨\n\n*Details:* <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View the failure log>"
}
}
]
}
# yamllint enable rule:line-length
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}