Skip to content

🚀 [Feature] : Covert it to svelte components with the same design #1

🚀 [Feature] : Covert it to svelte components with the same design

🚀 [Feature] : Covert it to svelte components with the same design #1

name: Discord Notification on Issue Creation
on:
issues:
types: [labeled]
jobs:
send-notification:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'bug') || contains(github.event.issue.labels.*.name, 'feature')
steps:
- name: Fetch Issue Details
id: get_issue_details
run: |
API_RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }})
echo "API Response: $API_RESPONSE"
ISSUE_URL=$(echo "$API_RESPONSE" | jq -r '.html_url')
ISSUE_TITLE=$(echo "$API_RESPONSE" | jq -r '.title')
REPO_NAME="${{ github.repository }}"
echo "issue_url=$ISSUE_URL" >> $GITHUB_ENV
echo "issue_title=$ISSUE_TITLE" >> $GITHUB_ENV
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV
- name: Send Discord Github Issues
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_GITHUB_ISSUES_WEBHOOK }}
ISSUE_URL: ${{ env.issue_url }}
ISSUE_TITLE: ${{ env.issue_title }}
REPO_NAME: ${{ env.repo_name }}
run: |
SUBTITLE="New issue in Repo: $REPO_NAME, Title: $ISSUE_TITLE"
PAYLOAD=$(jq -n --arg url "$ISSUE_URL" --arg st "$SUBTITLE" '{content: ($st + "\n\n" + $url)}')
curl -H "Content-Type: application/json" -X POST -d "$PAYLOAD" $DISCORD_WEBHOOK