Skip to content

Commit ab7541d

Browse files
ci: send slack message when ci fails on main
1 parent 407cf62 commit ab7541d

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/workflows/on-merge.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,24 @@ jobs:
99
test:
1010
uses: ./.github/workflows/test.yaml
1111
secrets: inherit
12+
13+
notify-slack:
14+
needs: test
15+
if: failure()
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Send Slack Notification
19+
uses: slackapi/[email protected]
20+
with:
21+
payload: |
22+
{
23+
"text": ":rotating_light: *CI FAILED on main!*",
24+
"attachments": [
25+
{
26+
"color": "danger",
27+
"text": "Workflow: ${{ github.workflow }}\nJob: ${{ github.job }}\nCommit: ${{ github.sha }}\nAuthor: ${{ github.actor }}"
28+
}
29+
]
30+
}
31+
env:
32+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/on-pull-request.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,24 @@ jobs:
1212

1313
check_formatting:
1414
uses: ./.github/workflows/check_formatting.yaml
15+
16+
notify-slack:
17+
needs: test
18+
if: failure()
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Send Slack Notification
22+
uses: slackapi/[email protected]
23+
with:
24+
payload: |
25+
{
26+
"text": ":rotating_light: *CI FAILED on main!*",
27+
"attachments": [
28+
{
29+
"color": "danger",
30+
"text": "Workflow: ${{ github.workflow }}\nJob: ${{ github.job }}\nCommit: ${{ github.sha }}\nAuthor: ${{ github.actor }}"
31+
}
32+
]
33+
}
34+
env:
35+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

src/flow_test/test.cairo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,3 +3029,8 @@ fn enable_disable_btc_tokens_flow_test() {
30293029
.span();
30303030
assert!(tokens == expected_tokens);
30313031
}
3032+
3033+
#[test]
3034+
fn test_test() {
3035+
panic!("test");
3036+
}

0 commit comments

Comments
 (0)