Week32 문제 풀었습니다.
#59
This file contains hidden or 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: 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" |