Skip to content
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

chore(*): slack 알림 연동 test #27

Closed
wants to merge 23 commits into from
Closed
18 changes: 6 additions & 12 deletions .github/workflows/slack-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
id: determine_event
run: echo "event_type=${{ github.event_name }}" >> $GITHUB_ENV

- name: Read user mapping
id: read_mapping
run: |
mapping=$(cat .github/user-mapping.json)
echo "mapping=$mapping" >> $GITHUB_ENV

- name: Cache Slack message timestamp
if: ${{ env.event_type == 'pull_request' }}
uses: actions/cache@v2
Expand All @@ -38,7 +32,7 @@ jobs:
id: slack_pr
run: |
response=$(curl -X POST -H 'Content-type: application/json' --data '{
"text": "🧞‍♂️ PR 드리는 지니가 왔습니다\n[sambad#${{ github.event.pull_request.number }}] [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})\n${{ github.event.pull_request.user.login }}님이 생성했어요."
"text": "*🧞‍♂️ PR 드리는 지니가 왔습니다~*\n*<${{ github.event.pull_request.html_url }}|[sambad#${{ github.event.pull_request.number }}] [${{ github.event.pull_request.title }}]>*\n${{ github.event.pull_request.user.login }}님이 생성했어요."
}' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }})
echo "slack_ts=$(echo $response | jq -r '.ts')" >> $GITHUB_ENV
echo $slack_ts > slack_ts.txt
Expand All @@ -49,10 +43,10 @@ jobs:
if: ${{ env.event_type == 'pull_request' && github.event.action == 'review_requested' }}
run: |
reviewer=${{ github.event.requested_reviewer.login }}
slack_username=$(echo ${{ env.mapping }} | jq -r --arg reviewer "$reviewer" '.[$reviewer]')
slack_username=$(cat .github/user-mapping.json | jq -r --arg reviewer "$reviewer" '.[$reviewer]')
if [ "$slack_username" != "null" ]; then
response=$(curl -X POST -H 'Content-type: application/json' --data '{
"text": "🔔 리뷰 요청이 도착했습니다: @'$slack_username'"
"text": "*🔔 리뷰 요청이 도착했습니다*: @'$slack_username'"
}' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }})
echo "slack_ts=$(echo $response | jq -r '.ts')" >> $GITHUB_ENV
echo $slack_ts > slack_ts.txt
Expand Down Expand Up @@ -80,10 +74,10 @@ jobs:
if: ${{ env.event_type == 'issue_comment' && env.SLACK_MESSAGE_TS != '' }}
run: |
commenter=${{ github.event.comment.user.login }}
slack_username=$(echo ${{ env.mapping }} | jq -r --arg commenter "$commenter" '.[$commenter]')
slack_username=$(cat .github/user-mapping.json | jq -r --arg commenter "$commenter" '.[$commenter]')
if [ "$slack_username" != "null" ]; then
curl -X POST -H 'Content-type: application/json' --data '{
"text": "@'$slack_username'님이 코멘트를 달았습니다:\n${{ github.event.comment.body }}",
"text": "@'$slack_username'님이 코멘트를 달았습니다 💌:\n${{ github.event.comment.body }}",
"thread_ts": "${{ env.SLACK_MESSAGE_TS }}"
}' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }}
else
Expand All @@ -96,7 +90,7 @@ jobs:
if: ${{ env.event_type == 'pull_request_review' && github.event.review.state == 'approved' && env.SLACK_MESSAGE_TS != '' }}
run: |
reviewer=${{ github.event.review.user.login }}
slack_username=$(echo ${{ env.mapping }} | jq -r --arg reviewer "$reviewer" '.[$reviewer]')
slack_username=$(cat .github/user-mapping.json | jq -r --arg reviewer "$reviewer" '.[$reviewer]')
if [ "$slack_username" != "null" ]; then
curl -X POST -H 'Content-type: application/json' --data '{
"text": "✅ @'$slack_username'님이 승인하셨어요 🎉",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/second/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { SecondDomainExampleScreen } from '@sambad/domains/second-domain';
import Image from 'next/image';

import styles from '../page.module.css';

export default function Second() {
return (
<main className={styles.main}>
<SecondDomainExampleScreen />
test
</main>
);
}
Loading