Skip to content

Commit

Permalink
use cat
Browse files Browse the repository at this point in the history
  • Loading branch information
oarbusi committed Mar 21, 2024
1 parent a9607fc commit 9503cd2
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions scripts/generate-slack-notification-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,48 +30,50 @@ fi
if [ "$1" == "success" ]; then
text_value="HashiCorp Terraform Compatibility Matrix succeeded!"

json="{
\"text\": \"$text_value\",
\"blocks\": [
cat <<EOF
{
"text": "$text_value",
"blocks": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"$text_value\"
"type": "section",
"text": {
"type": "mrkdwn",
"text": "$text_value"
}
}
]
}"
}
EOF
else
text_value="HashiCorp Terraform Compatibility Matrix failed!"
server_url=$2
repository=$3
run_id=$4
json="{
\"text\": \"$text_value\",
\"blocks\": [
cat <<EOF
{
"text": "$text_value",
"blocks": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"$text_value\"
"type": "section",
"text": {
"type": "mrkdwn",
"text": "$text_value"
}
},
{
\"type\": \"actions\",
\"elements\": [
"type": "actions",
"elements": [
{
\"type\": \"button\",
\"text\": {
\"type\": \"plain_text\",
\"text\": \":github: Failed action\"
"type": "button",
"text": {
"type": "plain_text",
"text": ":github: Failed action"
},
\"url\": \"${server_url}/${repository}/actions/runs/${run_id}\"
"url": "${server_url}/${repository}/actions/runs/${run_id}"
}
]
}
]
}"
}
EOF
fi

echo "$json"

0 comments on commit 9503cd2

Please sign in to comment.