- GitHub Action to send a message to Microsoft Teams using a webhook
-
In order to use this, First you need is to create a Webhook in your Microsoft Teams Channel, follow this link for info about creating a webhook.
-
Add the created webhook uri in Ms_Teams_Webhook_URI on your repository's configs on Settings > Secrets. It is the Webhook URI of the dedicated Microsoft Teams channel for notification. Learn more about setting up GitHub Secrets
-
Add a new
step
on your github actions workflow code below:
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Microsoft Teams Webhook Message Bot
uses: myusufcse/microsoft-teams-message-bot@v1.1
with:
webhook: ${{ secrets.Ms_Teams_Webhook_URI }}
message: Your custom notification message
notification_color: success or danger or warning or info (optional)
button_link_text: The button text for navigation to link from Microsoft Teams channel (optional)
button_link: The button link for navigation from Microsoft Teams channel (optional)
- Simplified version of the code: Advice not to pass the webhook uri directly
- name: Microsoft Teams Webhook Message Bot
uses: myusufcse/microsoft-teams-message-bot@v1.1
with:
webhook: Your webhook uri
message: Your custom notification message