Created
July 8, 2026 09:11
-
-
Save kp666/60c3e4c9a985a2b2db9285095b9501c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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