Skip to content

Commit 82bd8cf

Browse files
authored
Update slack-webhook.yaml
1 parent ced0629 commit 82bd8cf

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed
Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
11
- name: Post a message in a channel
2-
3-
on:
4-
workflow_call:
5-
inputs:
6-
workflow-event:
7-
required: true
8-
type: string
9-
secrets:
10-
slackWebhookUrl:
11-
required: true
12-
13-
jobs:
14-
notify:
15-
name: PR notification
16-
runs-on: [ubuntu-latest]
17-
steps:
18-
- name: Post message
19-
uses: slackapi/[email protected]
20-
env:
21-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
22-
with:
23-
payload: |
24-
{
25-
"title": ${{ toJson(fromJson(inputs.workflow-event).title) }},
26-
"author": ${{ toJson(fromJson(inputs.workflow-event).user.login) }},
27-
"link": ${{ toJson(fromJson(inputs.workflow-event).html_url) }}
28-
}
2+
uses: slackapi/[email protected]
3+
with:
4+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
5+
webhook-type: incoming-webhook
6+
payload: |
7+
text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
8+
blocks:
9+
- type: "section"
10+
text:
11+
type: "mrkdwn"
12+
text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"

0 commit comments

Comments
 (0)