Skip to content

Week32 문제 풀었습니다. #59

Week32 문제 풀었습니다.

Week32 문제 풀었습니다. #59

Workflow file for this run

name: Notify Discord on PR Created
on:
pull_request:
types: [opened]
jobs:
notify-discord:
runs-on: ubuntu-latest
steps:
- name: Send PR info to Discord
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_USER: ${{ github.event.pull_request.user.login }}
PR_URL: ${{ github.event.pull_request.html_url }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_CHANNEL_ID_PR }}
BOT_TOKEN: ${{ secrets.REMINDER_BOT_TOKEN }}
run: |
MESSAGE="**새 PR이 생성됐습니다**\n\n📌 **제목**: \`${PR_TITLE}\`\n🙋‍♀️ **작성자**: ${PR_USER}\n🔗 [PR 바로가기](${PR_URL})"
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bot ${BOT_TOKEN}" \
-d "{\"content\": \"$MESSAGE\"}" \
https://discord.com/api/v10/channels/${DISCORD_WEBHOOK}/messages)
echo "Discord Response Code: $RESPONSE"