|
30 | 30 | PAYLOAD="{\"channel\": \"${SLACK_CHANNEL}\", \"blocks\": [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"\n\"}}, {\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \":warning: *Errors in Planner Web (Test: ${TEST_TYPE}, <${GH_REF}|ref>)*\"}}]}" |
31 | 31 |
|
32 | 32 | # Send slack notification |
33 | | - curl -H "Content-type: application/json" \ |
34 | | - --data "${PAYLOAD}" \ |
| 33 | + curl -X POST https://slack.com/api/chat.postMessage \ |
35 | 34 | -H "Authorization: Bearer ${SLACK_TOKEN}" \ |
36 | 35 | -H "Content-type: application/json; charset=utf-8" \ |
37 | | - -X POST https://slack.com/api/chat.postMessage |
| 36 | + --data "${PAYLOAD}" |
38 | 37 | echo "" |
39 | 38 | echo "** Slack notification sent: errors **" |
40 | | - curl -H "Content-type: application/json" \ |
41 | | - --data "${PAYLOAD_DETAILS}" \ |
| 39 | + curl -X POST https://slack.com/api/chat.postMessage \ |
42 | 40 | -H "Authorization: Bearer ${SLACK_TOKEN}" \ |
43 | 41 | -H "Content-type: application/json; charset=utf-8" \ |
44 | | - -X POST https://slack.com/api/chat.postMessage |
| 42 | + --data "${PAYLOAD_DETAILS}" |
45 | 43 | echo "" |
46 | 44 | echo "** Slack notification sent: error details **" |
47 | 45 | else |
48 | 46 | PAYLOAD="{\"channel\": \"${SLACK_CHANNEL}\", \"blocks\": [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"\n\"}}, {\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \":white_check_mark: *All good for Planner Web (Test: ${TEST_TYPE}, <${GH_REF}|ref>)*\"}}]}" |
49 | 47 |
|
50 | 48 | # Send slack notification |
51 | | - curl -H "Content-type: application/json" \ |
52 | | - --data "${PAYLOAD}" \ |
| 49 | + curl -X POST https://slack.com/api/chat.postMessage \ |
53 | 50 | -H "Authorization: Bearer ${SLACK_TOKEN}" \ |
54 | 51 | -H "Content-type: application/json; charset=utf-8" \ |
55 | | - -X POST https://slack.com/api/chat.postMessage |
| 52 | + --data "${PAYLOAD}" |
56 | 53 | echo "" |
57 | 54 | echo "** Slack notification sent: success **" |
58 | 55 | fi |
|
0 commit comments