From 14b430739402866839177badadae75a9835136a4 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 7 Feb 2024 13:23:37 -0800 Subject: [PATCH] chore(ci): manage webhooks example (#1791) --- .github/workflows/notifications.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/notifications.yml b/.github/workflows/notifications.yml index 116e5c09a..5c92652ba 100644 --- a/.github/workflows/notifications.yml +++ b/.github/workflows/notifications.yml @@ -1,15 +1,20 @@ -name: Notifications +name: Teams Notify on: - workflow_run: - workflows: [PR,Merge] - types: - - completed + # workflow_run: + # workflows: [PR,Merge] + # types: [completed] + workflow_dispatch: + +# Note: This workflow requires a Microsoft Teams Channel and webhook URI variable +# https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook + jobs: notify-teams-pr: if: ${{github.event.workflow_run.event == 'pull_request'}} runs-on: ubuntu-22.04 steps: - - uses: simbo/msteams-message-card-action@latest + # https://github.com/simbo/msteams-message-card-action + - uses: simbo/msteams-message-card-action@1.4.3 with: webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }} title: "${{github.event.workflow_run.head_commit.message}}" @@ -25,6 +30,7 @@ jobs: subtitle: ${{github.event.workflow_run.head_commit.timestamp}} image: ${{github.event.workflow_run.head_repository.owner.avatar_url}} text: PR Opened + notify-teams-merged: if: ${{github.event.workflow_run.event == 'push'}} runs-on: ubuntu-22.04 @@ -45,7 +51,9 @@ jobs: pr="" fi echo "pr=${pr}" >> $GITHUB_OUTPUT - - uses: simbo/msteams-message-card-action@latest + + # https://github.com/simbo/msteams-message-card-action + - uses: simbo/msteams-message-card-action@1.4.3 with: webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }} title: "${{github.event.workflow_run.head_commit.message}}"