diff --git a/.github/workflows/discord-pr.yml b/.github/workflows/discord-pr.yml new file mode 100644 index 0000000..c105335 --- /dev/null +++ b/.github/workflows/discord-pr.yml @@ -0,0 +1,27 @@ +name: Discord - PR notification + +on: + pull_request: + types: [opened, reopened, ready_for_review] + +jobs: + notify: + runs-on: ubuntu-20.04 + steps: + - name: Send Discord message + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_URL: ${{ github.event.pull_request.html_url }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} + PR_BASE: ${{ github.event.pull_request.base.ref }} + PR_HEAD: ${{ github.event.pull_request.head.ref }} + REPO: ${{ github.repository }} + run: | + payload=$(cat < $PR_BASE**\n$PR_URL" + } + EOF + ) + curl -H "Content-Type: application/json" -d "$payload" "$DISCORD_WEBHOOK_URL" \ No newline at end of file