Skip to content

Commit

Permalink
chore(ci): manage webhooks example (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Feb 7, 2024
1 parent 625b9fd commit 14b4307
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
title: "${{github.event.workflow_run.head_commit.message}}"
Expand All @@ -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
Expand All @@ -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/[email protected]
with:
webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
title: "${{github.event.workflow_run.head_commit.message}}"
Expand Down

0 comments on commit 14b4307

Please sign in to comment.