GitHub webhook - Discussions support
-
While Discord allows to use GitHub compatible webhooks, GitHub does not have a webhook for discuussions, yet. You might want to ask on https://github.community/ for GitHub to support Webhooks on discussions. However, you might be successful making a GitHub Action that triggers a discord webhook whenever a discussion is created.
With push events, the config looks like this:
name: "trigger discord webhook"
on: [push]
jobs:
doit:
runs-on: ubuntu-latest
steps:
- run: 'curl --location --request POST "${WEBHOOK}" --header "x-github-event: $TRIGGER" --header "x-github-delivery: $DELIVERY" --header "Content-Type: application/json" --data-raw "$(echo "$GITHUB_EVENT"|jq -c .)"'
env:
TRIGGER: "${{github.event_name}}"
DELIVERY: "${{github.sha}}"
WEBHOOK: "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID_HERE/YOUR_WEBHOOK_SECRET_HERE/github"
GITHUB_EVENT: "${{ toJson(github.event) }}"It might be similar for discussions.
As there is currently no discussion event (https://docs.github.com/en/actions/reference/events-that-trigger-workflows), you might be successfull with the issues (https://docs.github.com/en/actions/reference/events-that-trigger-workflows#issues) and issue_comment (https://docs.github.com/en/actions/reference/events-that-trigger-workflows#issue_comment) events.
0 -
Please do not use this place to post anything about developing ;-; there is already a place to discuss things like that [Click me]
-2 -
The question strictly was not about developing but was more of a feature request. I just noted that GitHub does not have this feature yet and I posted a potential workaround until this feature is implemented.
0
Please sign in to leave a comment.
Comments
3 comments