Table of contents
Open Table of contents
Get Going
A simplified way to send git notifications to the MS Teams channel
Step 1: Create an Incoming webhook in Teams:
- Create a channel under Teams
- Get the WebHook URL and copy
- Reference how to create a webhook URL: https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=dotnet
Step 2: Configure Webhook in GitHub:
- Settings -> Secret and Variables -> Actions -> New Repository Secret
- Name as: TEAMS_WEBHOOK_URL
- Value as: paste the webhook URL which you copied in step 1.2
Step 3: Allow permissions for GitHub Actions:
- Settings -> Actions -> General ->
- Allow all actions and reusable workflows -> Save
- Accessible from repositories in the ‘YourOrg’ organization -> Save
Step 4: Set up a workflow
- Actions -> set up a workflow yourself ->
- Add this in main.yml
name: MS Teams Notification
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# this is the new step
- uses: dchourasia/ms-teams-notification@1.0 # or "./" if in a local set-up
if: always()
with:
github-token: ${{ github.token }}
webhook-uri: ${{ secrets.TEAMS_WEBHOOK_URL }}
3. Commit changes:
Reference: https://github.com/marketplace/actions/microsoft-teams-notifications