Update congratsbot to support external PRs
This commit is contained in:
parent
adc767c515
commit
8a969007fb
1 changed files with 8 additions and 8 deletions
16
.github/workflows/congratsbot.yml
vendored
16
.github/workflows/congratsbot.yml
vendored
|
@ -1,21 +1,21 @@
|
||||||
name: "Discord:congratsbot"
|
name: "Discord:congratsbot"
|
||||||
|
|
||||||
# only trigger on pull request closed events
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
push:
|
||||||
types: [ closed ]
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
congrats:
|
congrats:
|
||||||
name: "Discord:congratsbot"
|
name: "discord:congratsbot"
|
||||||
# this job will only run if the PR has been merged
|
#if: github.event.commits[0] && !github.event.commits[1]
|
||||||
if: github.event.pull_request.merged == true
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Send a Discord notification if a PR was merged
|
- name: Send a Discord notification when a PR is merged
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
||||||
# DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
|
# DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
|
||||||
uses: Ilshidur/action-discord@0.3.2
|
uses: Ilshidur/action-discord@0.3.2
|
||||||
with:
|
with:
|
||||||
args: '**Sweet!** [@${{ github.event.pull_request.user.login }}](<${{ github.event.pull_request.user.url }}>) just merged GitHub PR[#${{ github.event.number }}: ${{ github.event.pull_request.title }}](<${{github.event.pull_request.url}}>)'
|
args: '**Sweet!** [@${{ github.event.commits[0].author.login }}](<${{ github.event.commits[0].author.url }}>) just merged [${{ github.event.commits[0].message }}](<${{github.event.commits[0].html_url}}>)'
|
||||||
|
|
Loading…
Reference in a new issue