Skip to content

Commit 2c85a66

Browse files
committed
Test raw
1 parent 4581394 commit 2c85a66

File tree

2 files changed

+28
-43
lines changed

2 files changed

+28
-43
lines changed

.github/actions/slack/action.yml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
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+
34
inputs:
4-
message:
5-
description: "Message to send"
5+
slack_token:
6+
description: 'Slack Bot User OAuth Token'
67
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'
1310
required: true
11+
method:
12+
description: 'Slack method to call'
13+
required: true
14+
default: 'chat.postMessage'
15+
1416
runs:
1517
using: 'composite'
18+
1619
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+
uses: slackapi/[email protected]
22+
with:
23+
errors: true
24+
method: ${{ inputs.method }}
25+
token: ${{ inputs.slack_token }}
26+
payload: ${{ inputs.payload }}

.github/workflows/default_completed.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,11 @@ jobs:
3131
event_text: ${{ needs.context.outputs.is_release_master && 'Release Master' || 'Release Tag' }}
3232
with:
3333
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 }}"

0 commit comments

Comments
 (0)