-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.55 KB
/
google-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Google Test
on: [push]
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: gtest
run: make gtest
# 参考資料
# - Slack が提供する GitHub Action "slack-send" を使って GitHub から Slack に通知する - Qiita
# https://qiita.com/seratch/items/28d09eacada09134c96c
# NOTE:
# "Repository: <${{ [以下略]"の部分は、良い感じに改行する方法を見つけられなかった...
- name: Failure Notification
if: failure()
uses: slackapi/slack-github-action@v1.21.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":warning: CI結果: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ job.status }}>"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\nBranch: `${{ github.ref_name }}`\nWorkflow: `${{ github.workflow }}`\nAuthor: <https://github.com/${{ github.event.sender.login }}|@${{ github.event.sender.login }}>"
}
]
}
]
}
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}