Skip to content

Issues with unreliable batching methods #11

Issues with unreliable batching methods

Issues with unreliable batching methods #11

Workflow file for this run

name: Create Discord thread
on:
pull_request:
types: [opened]
issues:
types: [opened]
jobs:
send:
name: Open Thread on Discord
runs-on: ubuntu-latest
steps:
- name: Send webhook
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
run: |
if [ "${{ github.event_name }}" == "issues" ]; then
EVENT_URL="${{ github.event.issue.html_url }}"
EVENT_TITLE="${{ github.event.issue.title }}"
elif [ "${{ github.event_name }}" == "pull_request" ]; then
EVENT_URL="${{ github.event.pull_request.html_url }}"
EVENT_TITLE="${{ github.event.pull_request.title }}"
fi
EMBED_JSON=$(jq -n \
--arg title "$EVENT_TITLE" \
--arg url "$EVENT_URL" \
'{
"embeds": [{
"title": $title,
"description": "[View issue/pull request](\($url))",
"color": 7506646
}],
"thread_name": $title
'})
curl -X POST -H "Content-Type: application/json" \
-d "$EMBED_JSON" \
$WEBHOOK_URL