Skip to content

Commit bbf166b

Browse files
improve the rich message
1 parent 203a7a3 commit bbf166b

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,35 @@ jobs:
3939
post-slack-notification-started:
4040
runs-on: ubuntu-latest
4141
steps:
42+
- name: Get current date and time
43+
id: date
44+
run: |
45+
RUN_DATE=$(date -u +%Y-%m-%d)
46+
RUN_TIME=$(date -u +%H:%M:%S)
47+
echo "date=$RUN_DATE" >> $GITHUB_OUTPUT
48+
echo "time=$RUN_TIME" >> $GITHUB_OUTPUT
49+
4250
- name: Post a message in a channel
4351
uses: slackapi/slack-github-action@v2.1.1
4452
with:
4553
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
4654
webhook-type: incoming-webhook
4755
payload: |
48-
text: "Simple suite pipeline started"
4956
blocks:
57+
- type: "header"
58+
text:
59+
type: "plain_text"
60+
text: "🚀 Simple suite pipeline started"
61+
- type: "context"
62+
elements:
63+
- type: "mrkdwn"
64+
text: "📅 ${{ steps.date.outputs.date }} 🕒 ${{ steps.date.outputs.time }} UTC"
65+
- type: "section"
66+
text:
67+
type: "mrkdwn"
68+
text: "Trigger: ${{ github.event_name }}"
69+
- type: "divider"
5070
- type: "section"
5171
text:
5272
type: "mrkdwn"
53-
text: "Trigger: ${{ github.event_name }}"
73+
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | View workflow run>"

0 commit comments

Comments
 (0)