Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
/ notify Public archive

Post GitHub workflow events to a Microsoft Teams webhook

License

Notifications You must be signed in to change notification settings

MichaelUrman/notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notify/teams

Post GitHub workflow events to a Microsoft Teams webhook

Configuration:

  • Create your incoming webhook in Microsoft Teams.
  • Optionally store the webhook URL in a secret (e.g. MSTEAMS_NOTIFY_HOOK_URL)
  • Run only after ensuring Go is on the Runner (uses: actions/setup-go)
  • Create your workflow yaml, running on any scenarios you want to notify about (See Workflow syntax and Events that trigger workflows)
  • Specify the secret or webhook URL in your workflow configuration:
on:
  push:
  pull_request:
  release:
  check_run:
  create:
  delete:
  public:
  pull_request:
  pull_request_review:
  pull_request_review_comment:

jobs:
  notify:
    name: "Notify Microsoft Teams"
    steps:
    - uses: actions/setup-go@v2
      with:
        go-version: '~1.14'
    # ...
    - uses: MichaelUrman/notify/teams@tip # or use a sha
      with:
        hookurl: ${{ secrets.MSTEAMS_NOTIFY_HOOK_URL }}

For reporting CI results, add a step after your CI step with if: always() and a job-status like this:

jobs:
  ci_test:
    name "Integration Tests"
    steps:
    - uses: actions/setup-go@v2
      with:
        go-version: '~1.14'

    # step here that runs integration tests

    - uses: MichaelUrman/notify/teams@tip
      if: always()
      with:
        hookurl: ${{ secrets.MSTEAMS_NOTIFY_HOOK_URL }}
        job-status: ${{ job.status }}

Alternately, you can report a specific step's outcome as the job-status:

      with:
        hookurl: ${{ secrets.MSTEAMS_NOTIFY_HOOK_URL }}
        job-status: ${{ steps.stepname.outcome }}

About

Post GitHub workflow events to a Microsoft Teams webhook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published