Setting up the Webster Webhook for Discord
The notification Discord bot is done through an automatic workflow script that notifies only when a pull request is created or merged.
If you want these instructions in video form: video
Note: the video also does go through a second way of doing it but we will follow the first way since we want the custom icon and name. Also, don't append the /github for the first step - mistake in the video (sorry Anton).
In Discord
- First, make a new discord channel under your project (name the channel
pror whatever you want). - Go to
settingsfor the newly created channel and go tointegrations. - Click on
Create Webhook, name the new webhook "Webster", if you have the icon, change it to the Webster icon (message Marketing and Design for the icon if not). - Copy the webhook url.
In GitHub
- Go to the GitHub repository for your project
- Go to
settings->secrets and variables->actions - Make a new repository secret and call it
DISCORD_WEBHOOK_URL
In the Repository
- Make a new workflow (file) under
.github/workflows(call itnotification.yml) -
Copy the code below into the file:
notification.ymlname: Pull Request Notifications on: pull_request: types: [opened, reopened, closed] jobs: pull_request_created: if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'reopened' runs-on: ubuntu-latest steps: - name: Discord Webhook Action uses: tsickert/discord-webhook@v5.3.0 with: webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} content: "Pull request opened: ${{ github.event.pull_request.title }} | Link: [View Pull Request](${{ github.event.pull_request.html_url }})" pull_request_merged: if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Discord Webhook Action uses: tsickert/discord-webhook@v5.3.0 with: webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} content: "Pull request merged: ${{ github.event.pull_request.title }}" -
Commit and push the changes