Github Actions - Sending Notifications to MS Teams

Github Actions - Sending Notifications to MS Teams

This is about sending notifications to MS Teams Channel via using Github Actions pipeline.

Link to Github Market Place -> Github Action


  • In the below stated example, separate job for Notifications has been created which will send the notification to the MS TEAMS CHANNEL irrespective of the build job status.
  • Message to be sent can be customized as per the need, you can include other properties as well using Github Contexts.
  • In order to use this, all you need is to create a Webhook in your MS TEAMS Channel, follow this link for info about creating a one.
  • Once you have created the webhook, just add the Webhook Address in secrets and utilise in your Action File in this manner ${{ secrets.SECRET_NAME }}.
  • Sample Usage

      name: Pipeline Name
          branches: [ branch_name ]
          branches: [ branch_name ]
          runs-on: ubuntu-latest
          - name: Demo Step
            run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$GITHUB_RUN_NUMBER
          runs-on: ubuntu-latest
          if: always()
          needs: build
          - name: Send a Notification
              id: notify
              uses: thechetantalwar/teams-notify@v2
              teams_webhook_url: ${{ secrets.TEAM_HOOK }}
              message: "Github Action Build Number ${{ github.run_number }} Completed for ${{ github.repository }} and the outcome is  ${{ }}."
  • The above stated sample will send a message like below Sample Notification

License: MIT