"filter" function not optional in "Framework.Load()" #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" | |
EVENT_BODY="${{ github.event.issue.body }}" | |
elif [ "${{ github.event_name }}" == "pull_request" ]; then | |
EVENT_URL="${{ github.event.pull_request.html_url }}" | |
EVENT_TITLE="${{ github.event.pull_request.title }}" | |
EVENT_BODY="${{ github.event.pull_request.body }}" | |
fi | |
EMBED_JSON=$(jq -n \ | |
--arg title "$EVENT_TITLE" \ | |
--arg url "$EVENT_URL" \ | |
--arg description "$EVENT_BODY" \ | |
--arg event_type "${{ github.event_name }}" \ | |
'{ | |
"embeds": [{ | |
"title": $event_type, | |
"url": $url, | |
"description": $description | |
}], | |
"thread_name": $title | |
'}) | |
curl -X POST -H "Content-Type: application/json" \ | |
-d "$EMBED_JSON" \ | |
$WEBHOOK_URL |