File tree Expand file tree Collapse file tree 2 files changed +28
-43
lines changed Expand file tree Collapse file tree 2 files changed +28
-43
lines changed Original file line number Diff line number Diff line change 1
- name : Send slack message
2
- description : Send a slack message
1
+ name : ' Send Slack Message'
2
+ description : ' Sends a message to a specified Slack channel'
3
+
3
4
inputs :
4
- message :
5
- description : " Message to send "
5
+ slack_token :
6
+ description : ' Slack Bot User OAuth Token '
6
7
required : true
7
- channel :
8
- description : " The channel to send the message to"
9
- required : false
10
- default : " test-github-features"
11
- webhook_url :
12
- description : " The webhook url to use"
8
+ payload :
9
+ description : ' JSON payload to send to Slack'
13
10
required : true
11
+ method :
12
+ description : ' Slack method to call'
13
+ required : true
14
+ default : ' chat.postMessage'
15
+
14
16
runs :
15
17
using : ' composite'
18
+
16
19
steps :
17
- - name : Send message
18
- uses : slackapi/slack-github-action@v1
19
- with :
20
- channel-id : ${{ inputs.channel }}
21
- text : ${{ inputs.message }}
22
- blocks :
23
- - type : context
24
- elements :
25
- - type : mrkdwn
26
- text : " :github: *Workflow Run:* ${{ env.workflow_run }}"
27
- - type : mrkdwn
28
- text : " :bust_in_silhouette: *Triggered by:* @${{ github.actor }}"
29
- - type : section
30
- text :
31
- type : mrkdwn
32
- text : ${{ inputs.message }}
33
- env :
34
- SLACK_WEBHOOK_URL : ${{ inputs.webhook_url }}
20
+ - name : Raw Slack payload
21
+
22
+ with :
23
+ errors : true
24
+ method : ${{ inputs.method }}
25
+ token : ${{ inputs.slack_token }}
26
+ payload : ${{ inputs.payload }}
Original file line number Diff line number Diff line change @@ -31,18 +31,11 @@ jobs:
31
31
event_text : ${{ needs.context.outputs.is_release_master && 'Release Master' || 'Release Tag' }}
32
32
with :
33
33
slack_token : ${{ secrets.SLACK_TOKEN }}
34
- channel_id : ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
35
- message : |
36
- *Workflow*
37
- event: ${{ env.event_text }}
38
- url: ${{ github.event.workflow_run.url }}
39
- conclusion: ${{ github.event.workflow_run.conclusion }}
40
-
41
- *Commit*
42
- sha: ${{ github.event.workflow_run.head_commit.id }}
43
- message: ${{ github.event.workflow_run.head_commit.message }}
44
- author: ${{ github.event.workflow_run.head_commit.author.name }}
45
- date: ${{ github.event.workflow_run.head_commit.timestamp }}
46
-
47
- ${{ github.event.workflow_run.conclusion == 'failure' && env.retry_text || '' }}
48
-
34
+ method : chat.postMessage
35
+ payload : |
36
+ channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
37
+ blocks:
38
+ - type: context
39
+ elements:
40
+ - type: mrkdwn
41
+ text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
You can’t perform that action at this time.
0 commit comments