2021-08-08 18:05:30 +00:00
|
|
|
name: "Discord:congratsbot"
|
2021-08-08 18:02:43 +00:00
|
|
|
|
|
|
|
on:
|
2021-08-09 05:28:21 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-08-08 18:02:43 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
congrats:
|
2021-08-09 05:28:21 +00:00
|
|
|
name: "discord:congratsbot"
|
2021-08-18 05:19:25 +00:00
|
|
|
if: github.repository == 'snowpackjs/astro'
|
2021-08-08 18:02:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-09-01 05:26:41 +00:00
|
|
|
- id: setup
|
|
|
|
run: |
|
|
|
|
TRIMMED=$(echo "${{ github.event.commits[0].message }}" | sed '1!d;q')
|
|
|
|
echo "::set-output name=COMMIT_MSG::${TRIMMED}"
|
2021-08-09 05:28:21 +00:00
|
|
|
- name: Send a Discord notification when a PR is merged
|
2021-08-08 18:02:43 +00:00
|
|
|
env:
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
2021-08-08 18:25:13 +00:00
|
|
|
# DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
|
2021-08-08 18:02:43 +00:00
|
|
|
uses: Ilshidur/action-discord@0.3.2
|
|
|
|
with:
|
2021-09-01 05:26:41 +00:00
|
|
|
args: '**Sweet!** <${{ github.event.commits[0].author.name }}> just merged ["\"${{ steps.setup.outputs.COMMIT_MSG }}\""](<https://github.com/snowpackjs/astro/commits/main>) ```${{ github.event.commits[0].message }}```'
|