Skip to content

Commit

Permalink
fix: adding curl to get pr (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot authored Jan 5, 2024
1 parent 3ae2e0d commit 814c242
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,28 @@ jobs:
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: ${{github.event.workflow_run.event}}-${{github.event.workflow_run.status}}
text: |
${{github.event.workflow_run.event}}-${{github.event.workflow_run.status}}
notify-teams-merged:
if: ${{github.event.workflow_run.event == 'push'}}
runs-on: ubuntu-22.04
steps:
- name: PR Number
id: pr
uses: bcgov-nr/[email protected]
shell: bash
run: |
pr=$(\
curl -sL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ inputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/commits/${{ github.event.after }}/pulls \
| jq .[0].number
)
if [ -z "${pr}" ]
then
echo "No PR number found. Was this push triggered by a squashed PR merge?"
pr=""
fi
echo "pr=${pr}" >> $GITHUB_OUTPUT
- uses: simbo/msteams-message-card-action@latest
with:
webhook: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
Expand All @@ -43,4 +57,5 @@ jobs:
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: ${{github.event.workflow_run.event}}-${{github.event.workflow_run.status}}
text: |
${{github.event.workflow_run.event}}-${{github.event.workflow_run.status}}

0 comments on commit 814c242

Please sign in to comment.