File tree Expand file tree Collapse file tree 1 file changed +27
-11
lines changed
Expand file tree Collapse file tree 1 file changed +27
-11
lines changed Original file line number Diff line number Diff line change 11- name : Post a message in a channel
2- 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 }}"
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+ 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+ }
You can’t perform that action at this time.
0 commit comments