Skip to content

Notify Teams

Actions
Sending a notification to Microsoft Teams Channel
v2
Latest
Star (11)

Tags

 (2)

Microsoft Teams Notify - Github Actions

  • A Github Action to send Job Status to Microsoft Teams Channel

Usage

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

License: MIT

Notify Teams is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Sending a notification to Microsoft Teams Channel
v2
Latest

Tags

 (2)

Notify Teams is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.