-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (76 loc) · 2.59 KB
/
fe-ci-pr-review-message.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: FE/CI - PR 리뷰 준비 메시지 전송
on:
pull_request:
types: [opened, ready_for_review]
branches:
- fe/develop
jobs:
pr-ready:
runs-on: ubuntu-latest
steps:
- name: Set reviewer and sender variables
id: set-vars
run: |
echo "ASSIGNEE_SLACK_ID=${{ env[github.event.pull_request.assignee.login] }}" >> $GITHUB_ENV
- name: Set reviewer and sender nickname
id: set-nicks
run: |
echo "ASSIGNEE_NICKNAME=${{ env[format('{0}', env.ASSIGNEE_SLACK_ID)] }}" >> $GITHUB_ENV
- name: pr review 요청 -> 리뷰어에게 slack 멘션 알림
id: send-message
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.REVIEW_MENTION_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "divider"
},
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🎁 (#${{ github.event.pull_request.number }}) Pull Request가 준비되었습니다!",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n*진행자:*\n${{ env.ASSIGNEE_NICKNAME }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.event.pull_request.title }}*"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "👉🏻 PR 바로가기 👈🏻",
"emoji": true
},
"value": "바로가기 링크",
"url": "${{ github.event.pull_request.html_url }}",
"action_id": "button-action"
}
},
{
"type": "divider"
}
],
"icon_url": "${{ github.event.sender.avatar_url }}"
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Slack 메세지 ID를 PR comment에 등록
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
${{ steps.send-message.outputs.ts }}