Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tshanep authored Jan 31, 2024
1 parent 86531a2 commit 4e69c4c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Post Message to Microsoft Teams

on:
workflow_dispatch:
inputs:
message:
description: 'Message to send'
required: true

jobs:
notify:
runs-on: windows-latest
steps:
- name: Post Adaptive Card to Microsoft Teams
run: |
$body = @{
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 = "${{ github.event.inputs.message }}"
}
)
actions = @(
@{
type = "Action.OpenUrl"
title = "Create Pull Request"
url = "https://github.com/microsoft/Templates-for-Power-Platform"
}
)
}
}
)
} | ConvertTo-Json -Depth 10
curl -H "Content-Type: application/json" -d "$body" ${{ secrets.TEAMS_WEBHOOK_URL }}
shell: pwsh

0 comments on commit 4e69c4c

Please sign in to comment.