Skip to content

Commit

Permalink
try cat
Browse files Browse the repository at this point in the history
  • Loading branch information
oarbusi committed Mar 21, 2024
1 parent e52f623 commit a2df8ff
Showing 1 changed file with 41 additions and 39 deletions.
80 changes: 41 additions & 39 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\": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"$text_value\"
}
}
]
}"
cat <<EOF
{
"text": "$text_value",
"blocks": [
{
"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\": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"$text_value\"
}
},
{
\"type\": \"actions\",
\"elements\": [
{
\"type\": \"button\",
\"text\": {
\"type\": \"plain_text\",
\"text\": \":github: Failed action\"
},
\"url\": \"${server_url}/${repository}/actions/runs/${run_id}\"
}
]
}
]
}"
cat <<EOF
{
"text": "$text_value",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "$text_value"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": ":github: Failed action"
},
"url": "${server_url}/${repository}/actions/runs/${run_id}"
}
]
}
]
}
EOF
fi

echo "$json"

0 comments on commit a2df8ff

Please sign in to comment.