Skip to content

Commit 51bdc3b

Browse files
authored
Fix Slack message formatting. (#30)
Signed-off-by: Carrie Dils <[email protected]> Signed-off-by: Carrie Dils <[email protected]>
1 parent 4054b4f commit 51bdc3b

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/create-tech-call-discussion.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,22 @@ jobs:
9797
if: ${{ steps.check_existing.outputs.found != 'true' && steps.create_discussion.outcome == 'success' && steps.create_discussion.outputs.discussion-url != '' }}
9898
env:
9999
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_FAIR_MEETING_ANNOUNCER }}
100+
DATE_DISPLAY: ${{ steps.vars.outputs.date_display }}
101+
TZ_LINK: ${{ steps.vars.outputs.tz_link }}
102+
DISCUSSION_URL: ${{ steps.create_discussion.outputs.discussion-url }}
100103
run: |
101104
payload=$(jq -n \
102-
--arg text ":spiral_calendar_pad: *Tech Call Agenda Posted*\n*Date:* ${{ steps.vars.outputs.date_display }} (17:30 UTC)\n:link: <${{ steps.create_discussion.outputs.discussion-url }}|View agenda>\n:earth_americas: <${{ steps.vars.outputs.tz_link }}|See in your timezone>" \
103-
'{text: $text}')
105+
--arg d "$DATE_DISPLAY" \
106+
--arg url "$DISCUSSION_URL" \
107+
--arg tz "$TZ_LINK" \
108+
'{
109+
blocks: [
110+
{ "type": "section", "text": { "type": "mrkdwn", "text": ":spiral_calendar_pad: *Tech Call Agenda Posted*" } },
111+
{ "type": "section", "text": { "type": "mrkdwn", "text": ("*Date:* " + $d + " (17:30 UTC)") } },
112+
{ "type": "section", "text": { "type": "mrkdwn", "text": (":link: <" + $url + "|View agenda>") } },
113+
{ "type": "section", "text": { "type": "mrkdwn", "text": (":earth_americas: <" + $tz + "|See in your timezone>") } }
114+
]
115+
}')
104116
curl -sS -X POST -H 'Content-type: application/json' --data "$payload" "$SLACK_WEBHOOK_URL"
105117
106118
- name: Skip Slack notification

.github/workflows/create-tsc-call-discussion.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,22 @@ jobs:
9797
if: ${{ steps.check_existing.outputs.found != 'true' && steps.create_discussion.outcome == 'success' && steps.create_discussion.outputs.discussion-url != '' }}
9898
env:
9999
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_FAIR_MEETING_ANNOUNCER }}
100+
DATE_DISPLAY: ${{ steps.vars.outputs.date_display }}
101+
TZ_LINK: ${{ steps.vars.outputs.tz_link }}
102+
DISCUSSION_URL: ${{ steps.create_discussion.outputs.discussion-url }}
100103
run: |
101104
payload=$(jq -n \
102-
--arg text ":spiral_calendar_pad: *TSC General Meeting Agenda Posted*\n*Date:* ${{ steps.vars.outputs.date_display }} (19:00 UTC)\n:link: <${{ steps.create_discussion.outputs.discussion-url }}|View agenda>\n:earth_americas: <${{ steps.vars.outputs.tz_link }}|See in your timezone>" \
103-
'{text: $text}')
105+
--arg d "$DATE_DISPLAY" \
106+
--arg url "$DISCUSSION_URL" \
107+
--arg tz "$TZ_LINK" \
108+
'{
109+
blocks: [
110+
{ "type": "section", "text": { "type": "mrkdwn", "text": ":spiral_calendar_pad: *TSC General Call Agenda Posted*" } },
111+
{ "type": "section", "text": { "type": "mrkdwn", "text": ("*Date:* " + $d + " (19:00 UTC)") } },
112+
{ "type": "section", "text": { "type": "mrkdwn", "text": (":link: <" + $url + "|View agenda>") } },
113+
{ "type": "section", "text": { "type": "mrkdwn", "text": (":earth_americas: <" + $tz + "|See in your timezone>") } }
114+
]
115+
}')
104116
curl -sS -X POST -H 'Content-type: application/json' --data "$payload" "$SLACK_WEBHOOK_URL"
105117
106118
- name: Skip Slack notification

0 commit comments

Comments
 (0)