Skip to content

Instantly share code, notes, and snippets.

@lukas-h
Last active April 12, 2024 09:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukas-h/84650d7b4d0ec487d35e4a05d3d3d4b1 to your computer and use it in GitHub Desktop.
Save lukas-h/84650d7b4d0ec487d35e4a05d3d3d4b1 to your computer and use it in GitHub Desktop.
Discord Motivational Gong Bot (on pull request merge)
  1. Put the gong-bot.yml in the folder .github/workflows in your repository
  2. Add a new webhook in the Discord Server Settings > Integrations > Webhooks
  3. Copy the webhook url
  4. Add the secret DISCORD_WEBHOOK in your GitHub repository Actions secrets

This is the gong gif:

name: Run gong bot
on:
pull_request:
types:
- closed
jobs:
gong:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: 'Repository {{ EVENT_PAYLOAD.repository.full_name }} has a new pull request merged on main: [#{{ EVENT_PAYLOAD.pull_request.number }}](https://github.com/{{ EVENT_PAYLOAD.repository.full_name }}/pull/{{ EVENT_PAYLOAD.pull_request.number }}). https://tenor.com/view/gong-exatl%C3%B3n-antonio-rosique-pegada-bang-gif-23256866'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment