Skip to content

Commit

Permalink
Merge pull request #151 from Axway/APIGOV-00001
Browse files Browse the repository at this point in the history
APIGOV-00001 - change Teams message
  • Loading branch information
dfeldick authored Aug 9, 2024
2 parents e291d89 + 5107c08 commit d5b3d0b
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash
shopt -s nocasematch

# you can add variables like this to test locally. Just run ./release.sh. Note that to run on MAC, you must install bash 5.x.
# you can add variables like this to test locally. Just run ./release.sh. Note that to run on MAC, you must install bash 5.x.
# Then, to run the script you must do: /usr/local/bin/bash ./release.sh
# TEAMS_WEBHOOK_URL="foo.bar"
# TAG="1.2.3"

TEAMS_WEBHOOK_URL="https://prod-34.westeurope.logic.azure.com:443/workflows/31b656992447483d9697ba3ab594f23c/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=OdGkZRZvMUJjiy7Ex6K2CCgeG5LUsYXTxXo-7CKAJTw"

# Would like to use this, but can't get it to work in curl command
#export COMMON_CURL_HEADER=`printf -- '-H "PRIVATE-TOKEN:${GIT_API_TOKEN}" -H "Accept:application/json" -H "Content-Type:application/json"'`
export H_ACCEPT="Accept:application/json"
Expand Down Expand Up @@ -50,24 +52,10 @@ post_to_teams() {
return 0
fi

rel_date=$(date +'%m/%d/%Y')
JSON="{
\"@type\": \"MessageCard\",
\"@context\": \"http://schema.org/extensions\",
\"summary\": \"Agent Release Info\",
\"sections\": [{
\"facts\": [{
\"name\": \"Date:\",
\"value\": \"${rel_date}\"
}, {
\"name\": \"Info:\",
\"value\": \"${1}\"
}]
}]
}"
curl -v ${TEAMS_WEBHOOK_URL} \
-H 'Content-Type: application/json' \
-d "${JSON}" &> /dev/null
\"info\": \"${1}\"
}"
curl -v ${TEAMS_WEBHOOK_URL} -H 'Content-Type: application/json' -d "${JSON}" &> /dev/null
}

main() {
Expand Down

0 comments on commit d5b3d0b

Please sign in to comment.