Skip to content

Commit

Permalink
fix: using workflow notificaitons (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot authored Dec 27, 2023
1 parent 6c71515 commit 84e6300
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,27 @@
name: Notifications
on:
pull_request:
types: [opened,closed]
push:
branches: [main]
paths-ignore:
- '*.md'
- '.github/**'
- 'common/graphics/**'
- '!.github/workflows/deploy.yml'
- '!.github/workflows/merge.yml'
workflow_run: [PR,Merge]
jobs:
vars:
outputs:
pr: ${{ steps.pr.outputs.pr }}
notify-teams:
runs-on: ubuntu-22.04
timeout-minutes: 1
if: ${{ github.event.action == 'in_progress' || github.event.action == 'completed' }}
steps:
# Get PR number for squash merges to main
- id: pr
uses: bcgov-nr/[email protected]

- uses: dchourasia/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
show-on-exit: false
enable-view-status: false
on:
workflow_run: [PR Closed]
jobs:
notify-teams:
needs: [vars]
runs-on: ubuntu-22.04
if: ${{ github.event.action == 'completed' }}
steps:
- uses: dchourasia/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
custom-facts: |
- name: PR#
value: "${{ needs.vars.outputs.pr }}"
- name: Event
value: "${{ github.event_name }}"
- name: Type
value: "${{ github.event.action }}"
show-on-exit: false
enable-view-status: false

0 comments on commit 84e6300

Please sign in to comment.