diff --git a/.github/workflows/notify-slack-on-pr-merge.yml b/.github/workflows/notify-slack-on-pr-merge.yml new file mode 100644 index 0000000..afcc775 --- /dev/null +++ b/.github/workflows/notify-slack-on-pr-merge.yml @@ -0,0 +1,21 @@ +name: Slack Notification on PR Merge + +on: + pull_request: + types: [closed] + +jobs: + notify: + if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == github.event.repository.default_branch + runs-on: ubuntu-latest + + steps: + - name: Send Slack Notification + run: | + curl -X POST \ + -H 'Content-type: application/json' \ + --data '{ + "channel": "qa-messenger", + "text": "---\n**PR Merged** \n*Repo:* '"${{ github.repository }}"'\n*Title:* '"${{ github.event.pull_request.title }}"'\n*Tag:* <'"${{ secrets.SLACK_BORIS_MEMBER_ID }}"'> <'"${{ secrets.SLACK_BO_MEMBER_ID }}"'>\n*Link:* <'"${{ github.event.pull_request.html_url }}"'|View PR>" + }' \ + ${{ secrets.SLACK_QA_MESSENGER_WEBHOOK_URL }}