Skip to content

Instantly share code, notes, and snippets.

@kp666
Created July 8, 2026 09:11
Show Gist options
  • Select an option

  • Save kp666/60c3e4c9a985a2b2db9285095b9501c0 to your computer and use it in GitHub Desktop.

Select an option

Save kp666/60c3e4c9a985a2b2db9285095b9501c0 to your computer and use it in GitHub Desktop.
require "net/http"
require "json"
uri = URI(ENV["TEAMS_WEBHOOK_URL"])
payload = {
type: "message",
attachments: [
{
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
version: "1.5",
body: [
{
type: "TextBlock",
text: "Deployment completed successfully",
weight: "Bolder",
size: "Medium"
},
{
type: "TextBlock",
text: "Version: v1.2.3"
}
]
}
}
]
}
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req.body = payload.to_json
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
response = http.request(req)
puts response.code
puts response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment