Skip to content

Commit

Permalink
feat: Adding notifications to ping teams of deployment workflow status (
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot authored Jan 3, 2024
1 parent f95d0f0 commit 2f23ecf
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Notifications
on:
workflow_run:
workflows: [PR,Merge]
types:
- requested
- in_progess
- completed
jobs:
notify-teams-in-progress:
if: ${{github.event.workflow_run.status != 'completed'}}
runs-on: ubuntu-22.04
steps:
- uses: simbo/msteams-message-card-action@latest
with:
webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
title: "PR# ${{github.event.workflow_run.pull_requests[0].number}}"
message: "${{github.event.workflow_run.head_commit.message}}"
color: ff69b4
buttons: |
Pull Request ${{github.event.workflow_run.pull_requests[0].number}} ${{github.event.workflow_run.repository.html_url}}/pull/${{github.event.workflow_run.pull_requests[0].number}}
Diff ${{github.event.workflow_run.repository.html_url}}/pull/${{github.event.workflow_run.pull_requests[0].number}}/files
sections: |
-
activity:
title: ${{github.event.workflow_run.head_commit.committer.name }}
subtitle: ${{github.event.workflow_run.head_commit.timestamp}}
image: ${{github.event.workflow_run.head_repository.owner.avatar_url}}
text: |
status: ${{github.event.workflow_run.status}}
notify-teams-completed:
if: ${{github.event.workflow_run.status == 'completed'}}
runs-on: ubuntu-22.04
steps:
- uses: simbo/msteams-message-card-action@latest
with:
webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
title: "PR# ${{github.event.workflow_run.pull_requests[0].number}}"
message: "${{github.event.workflow_run.head_commit.message}}"
color: 28a745
buttons: |
Pull Request ${{github.event.workflow_run.pull_requests[0].number}} ${{github.event.workflow_run.repository.html_url}}/pull/${{github.event.workflow_run.pull_requests[0].number}}
Diff ${{github.event.workflow_run.repository.html_url}}/pull/${{github.event.workflow_run.pull_requests[0].number}}/files
sections: |
-
activity:
title: ${{github.event.workflow_run.head_commit.committer.name}}
subtitle: ${{github.event.workflow_run.head_commit.timestamp}}
image: ${{github.event.workflow_run.head_repository.owner.avatar_url}}
text: |
status: ${{github.event.workflow_run.status}}

0 comments on commit 2f23ecf

Please sign in to comment.