-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dev 브랜치로 PR 요청, 병합 시 슬랙에 알림 보내는 기능 추가 (#20)
- Loading branch information
1 parent
68d2340
commit 47ceab6
Showing
2 changed files
with
159 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Closed PR Notification | ||
on: | ||
pull_request: | ||
branches: [ dev ] | ||
types: [ closed ] | ||
|
||
jobs: | ||
create-issue: | ||
name: PR closed notification to slack | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send closed PR notification | ||
if: github.event.pull_request.merged != true | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"text": "*PR이 닫혔습니다!*", | ||
"attachments": [ | ||
{ | ||
"color": "#CF2027", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Title*\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Base branch*\n${{ github.base_ref }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Compare branch*\n${{ github.head_ref }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*PR number*\n#${{ github.event.pull_request.number }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Author*\n${{ github.event.pull_request.user.login }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
- name: Send merged PR notification | ||
if: github.event.pull_request.merged == true | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"text": "*PR이 머지됐습니다!*", | ||
"attachments": [ | ||
{ | ||
"color": "#7539DE", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Title*\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Base branch*\n${{ github.base_ref }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Compare branch*\n${{ github.head_ref }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*PR number*\n#${{ github.event.pull_request.number }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Author*\n${{ github.event.pull_request.user.login }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Opened PR Notification | ||
on: | ||
pull_request: | ||
branches: [ dev ] | ||
types: [ opened ] | ||
|
||
jobs: | ||
create-issue: | ||
name: PR opened notification to slack | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send opened PR notification | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"text": "*새로운 PR이 생성되었습니다!*", | ||
"attachments": [ | ||
{ | ||
"color": "#1F7629", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Title*\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Base branch*\n${{ github.base_ref }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Compare branch*\n${{ github.head_ref }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*PR number*\n#${{ github.event.pull_request.number }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Author*\n${{ github.event.pull_request.user.login }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |