Skip to content

Commit 6196cd0

Browse files
use the action for rich message
1 parent bb0c56b commit 6196cd0

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

.github/workflows/auto-simple-suite.yaml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,38 @@ jobs:
3636
path: playwright-report/
3737
retention-days: 7
3838

39-
- name: Post to Slack
40-
env:
41-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
42-
run: |
43-
curl -X POST -H 'Content-type: application/json' \
44-
--data '{"text":"Simple suite results are ready"}' \
45-
$SLACK_WEBHOOK_URL
39+
post-slack-notification-started:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Post a message in a channel
43+
uses: slackapi/slack-github-action@v2.1.1
44+
with:
45+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
46+
webhook-type: incoming-webhook
47+
payload: |
48+
{
49+
"text": "Simple suite pipeline started",
50+
"blocks": [
51+
{
52+
"type": "header",
53+
"text": {
54+
"type": "mrkdwn",
55+
"text": "Simple suite pipeline started"
56+
}
57+
},
58+
{
59+
"type": "section",
60+
"text": {
61+
"type": "mrkdwn",
62+
"text": "Trigger: ${{ github.event_name }}"
63+
}
64+
},
65+
{
66+
"type": "section",
67+
"text": {
68+
"type": "mrkdwn",
69+
"text": "View workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>"
70+
}
71+
}
72+
]
73+
}

0 commit comments

Comments
 (0)