Skip to content

Commit 41ea227

Browse files
chore(ci): add slack notification when failure (#1622)
1 parent d8b7631 commit 41ea227

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.github/workflows/daily_ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
# This workflow runs every weekday at 15:00 UTC (8AM PDT)
22
name: Daily CI
33

4+
permissions:
5+
id-token: write
6+
contents: read
7+
48
on:
59
schedule:
610
- cron: "00 15 * * 1-5"
7-
11+
pull_request:
12+
paths:
13+
.github/workflows/daily_ci.yml
814
jobs:
915
DAILY_CI:
1016
# Don't run the cron builds on forks
1117
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
12-
uses: ./.github/workflows/ci.yml
18+
uses: ./.github/workflows/ci.yml
19+
notify:
20+
needs:
21+
[
22+
DAILY_CI
23+
]
24+
if: ${{ failure() && github.event_name == 'schedule'}}
25+
uses: ./.github/workflows/slack-notification.yml
26+
with:
27+
message: "Daily CI failed on `${{ github.repository }}`. View run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
28+
secrets:
29+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CI }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Issue Created Notification
2+
permissions:
3+
contents: read
4+
on:
5+
issues:
6+
types: [opened, reopened]
7+
issue_comment:
8+
types: [created]
9+
10+
jobs:
11+
notify-issue:
12+
if: github.event_name == 'issues'
13+
uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main
14+
with:
15+
message: "New github issue `${{ github.event.issue.title }}`. Link: ${{ github.event.issue.html_url }}"
16+
secrets:
17+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GHI }}
18+
19+
notify-comment:
20+
if: github.event_name == 'issue_comment' && !github.event.issue.pull_request
21+
uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main
22+
with:
23+
message: "New comment on issue `${{ github.event.issue.title }}`. Link: ${{ github.event.comment.html_url }}"
24+
secrets:
25+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GHI }}

0 commit comments

Comments
 (0)