-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] 디스코드 알림 기능 수정 #37
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ jobs: | |
steps: | ||
- name: Set Environment Variables | ||
run: | | ||
echo "AVATAR_URL=${{ secrets.DISCORD_AVATAR_URL }}" >> $GITHUB_ENV | ||
echo "USERNAME=디코봇" >> $GITHUB_ENV | ||
echo "WEB_HOOK=${{ secrets.DISCORD_WEB_HOOK }}" >> $GITHUB_ENV | ||
|
||
- name: Set Environment Variables for PR Comments | ||
|
@@ -24,8 +22,8 @@ jobs: | |
echo "PR_URL=${{ github.event.issue.pull_request.html_url }}" >> $GITHUB_ENV | ||
echo "AUTHOR_URL=${{ github.event.comment.user.avatar_url }}" >> $GITHUB_ENV | ||
echo "CONTENT=$(echo '${{ github.event.comment.body }}' | base64 -w 0)" >> $GITHUB_ENV | ||
echo "COMMENT_BODY=${{ github.event.issue.title }}" >> $GITHUB_ENV | ||
echo "TITLE=Pull Request" >> $GITHUB_ENV | ||
echo "TITLE=${{ github.event.issue.title }}" >> $GITHUB_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ 이슈 & PR 제목을 title로 하고 comment_body로 구분해주는 거군요! |
||
echo "COMMENT_BODY=Pull Request" >> $GITHUB_ENV | ||
|
||
- name: Set Environment Variables for PR Review Comment | ||
if: ${{ contains(github.event.review.body, '/noti') }} | ||
|
@@ -34,8 +32,8 @@ jobs: | |
echo "PR_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV | ||
echo "AUTHOR_URL=${{ github.event.review.user.avatar_url }}" >> $GITHUB_ENV | ||
echo "CONTENT=$(echo '${{ github.event.review.body }}' | base64 -w 0)" >> $GITHUB_ENV | ||
echo "COMMENT_BODY=${{ github.event.pull_request.title }}" >> $GITHUB_ENV | ||
echo "TITLE=Pull Request" >> $GITHUB_ENV | ||
echo "TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV | ||
echo "COMMENT_BODY=Pull Request" >> $GITHUB_ENV | ||
|
||
- name: Set Environment Variables for Issue | ||
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/noti') }} | ||
|
@@ -44,8 +42,8 @@ jobs: | |
echo "PR_URL=${{ github.event.issue.html_url }}" >> $GITHUB_ENV | ||
echo "AUTHOR_URL=${{ github.event.comment.user.avatar_url }}" >> $GITHUB_ENV | ||
echo "CONTENT=$(echo '${{ github.event.comment.body }}' | base64 -w 0)" >> $GITHUB_ENV | ||
echo "COMMENT_BODY=${{ github.event.issue.title }}" >> $GITHUB_ENV | ||
echo "TITLE=Issue" >> $GITHUB_ENV | ||
echo "TITLE=${{ github.event.issue.title }}" >> $GITHUB_ENV | ||
echo "COMMENT_BODY=Issue" >> $GITHUB_ENV | ||
|
||
- name : Set Discord Content | ||
if: ${{ env.CONTENT }} | ||
|
@@ -71,9 +69,7 @@ jobs: | |
- name: Notify Discord | ||
if: ${{ env.COMMENT_AUTHOR && env.PR_URL && env.AUTHOR_URL && env.DISCORD_CONTENT && env.COMMENT_BODY }} | ||
env: | ||
AVATAR_URL: ${{ env.AVATAR_URL }} | ||
COMMENT_BODY: ${{ env.COMMENT_BODY }} | ||
USERNAME: ${{ env.USERNAME }} | ||
WEB_HOOK: ${{ env.WEB_HOOK }} | ||
COMMENT_AUTHOR: ${{ env.COMMENT_AUTHOR }} | ||
PR_URL: ${{ env.PR_URL }} | ||
|
@@ -86,8 +82,6 @@ jobs: | |
JSON_PAYLOAD=$(jq -n \ | ||
--arg content "$CONTENT_DECODED" \ | ||
--arg description "$COMMENT_BODY" \ | ||
--arg username "$USERNAME" \ | ||
--arg avatar_url "$AVATAR_URL" \ | ||
--arg title "$TITLE" \ | ||
--arg url "$PR_URL" \ | ||
--arg author_url "$AUTHOR_URL" \ | ||
|
@@ -96,8 +90,8 @@ jobs: | |
--arg timestamp "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ | ||
'{ | ||
content: $content, | ||
username: $username, | ||
avatar_url: $avatar_url, | ||
username: $author_name, | ||
avatar_url: $author_url, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ $author_url은 작성자 프로필 이미지를 가져오는 변수명으로 생각되네요! 좋아요. |
||
allowed_mentions: { | ||
parse: ["users", "roles"] | ||
}, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍