@@ -18,23 +18,32 @@ jobs:
18
18
cat linkcheck_output.txt
19
19
echo EOF
20
20
} >> "$GITHUB_ENV"
21
- - name : Send message to Slack
22
- if : always()
23
-
24
- id : initial_message
25
- with :
26
- webhook : ${{ secrets.SLACK_WEBHOOK_URL }}
27
- webhook-type : incoming-webhook
28
- payload : |
29
- channel: ${{ secrets.SLACK_CHANNEL_ID }}
30
- text: "Link check results are available in :thread:."
31
- - name : Reply with output of linkcheck
32
- if : always()
33
- uses :
slackapi/[email protected] # ref: https://github.com/slackapi/slack-github-action
34
- with :
35
- webhook : ${{ secrets.SLACK_WEBHOOK_URL }}
36
- webhook-type : incoming-webhook
37
- payload : |
38
- channel: ${{ secrets.SLACK_CHANNEL_ID }}
39
- thread_ts: "{{ steps.initial_message.outputs.ts }}"
40
- text: "$LINKCHECK_OUTPUT"
21
+ # - name: Send message to Slack
22
+ # if: always()
23
+ # uses: slackapi/[email protected]
24
+ # id: initial_message
25
+ # with:
26
+ # webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
27
+ # webhook-type: incoming-webhook
28
+ # payload: |
29
+ # channel: ${{ secrets.SLACK_CHANNEL_ID }}
30
+ # text: "Link check results are available in :thread:."
31
+ - name : Send a message to Slack via Webhook
32
+ id : send_message
33
+ run : |
34
+ response=$(curl -s -X POST -H 'Content-type: application/json' \
35
+ --data '{
36
+ "text": "Link check results are available in :thread:."
37
+ }' ${{ secrets.SLACK_WEBHOOK_URL }})
38
+ echo "response=$response" >> $GITHUB_ENV
39
+ - name : Save thread_ts
40
+ run : |
41
+ echo "thread_ts=<MANUALLY_SET_OR_CAPTURE_THIS_VALUE>" >> $GITHUB_ENV
42
+
43
+ - name : Reply to the thread via Webhook
44
+ run : |
45
+ curl -s -X POST -H 'Content-type: application/json' \
46
+ --data '{
47
+ "text": "This is a reply to the thread.",
48
+ "thread_ts": "${{ env.thread_ts }}"
49
+ }' ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments