Skip to content

Commit

Permalink
Fixed order of CURL arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jura committed Dec 22, 2024
1 parent f8066eb commit ee39a45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ slackpost()
# https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=newteams%2Cjavascript
escapedText=$(echo $TEXT | sed 's/"/\"/g' | sed "s/'/\'/g")
json="{\"type\": \"message\", \"attachments\": [{\"contentType\": \"application/vnd.microsoft.card.adaptive\",\"contentUrl\": null,\"content\": {\"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\": \"AdaptiveCard\",\"version\": \"1.2\",\"body\": [{\"type\": \"TextBlock\",\"text\": \"$escapedText\"}]}}]}"
curl -s -d -H "Content-Type: application/json" "$json" "$TEAMS_WEBHOOK_URL" || logline "Failed to send message to Teams: ${USERNAME}: ${TEXT}"
curl -s -H "Content-Type: application/json" -d "$json" "$TEAMS_WEBHOOK_URL" || logline "Failed to send message to Teams: ${USERNAME}: ${TEXT}"
else
logline "No Slack/Teams: ${USERNAME}: ${TEXT}"
fi
Expand Down

0 comments on commit ee39a45

Please sign in to comment.