Integrate PR review activities into Slack with GitHub actions without a webhook server. All you need to do is add a github action workflow.
english is default.
- PR review notifications will be sent to the channel you set when you opened the PR.
- "@reviewer has sent a review request to @reviewer"
- The repo, PR title (PR LINK), PR description, and LABEL information will be sent along with it.
-
if you add a reviewer, they will be mentioned in the PR opening message.
-
If you label the PR open with emergency, it will be accompanied by an "emergency" message.
- You can customize the label name.
-
When you comment, the comment is replied to the PR open message as a thread.
-
when you submit a PR review, you'll be commented on in the thread.
- comment: Reply as a comment.
- approve: Runs with LGTM message.
- request change: Runs with the request change message.
- emoji when closing a PR
- close: x emoji (customizable).
- merge: white_check_mark emoji (customizable)
- set language you want: it supports
english
,korean
now
- you need to create slack bot and add the bot to the channel.
you also need to add the permissions to slack bot like channels:history
, chat:write
, chat:write.public
, groups:history
, reactions:write
in OAuth & Permissions
- create a pr-slack-notifiy.yml document inside
.github/workflows
name: PR Slack Notification
on:
pull_request:
types: [opened, review_requested, closed]
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Notify Slack
uses: roseline124/codereview-action
with:
github_token: ${{ secrets.CODEREVIEWBOT_GITHUB_TOKEN }}
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_channel: <SLACK_CHANNEL_ID>
slack_workspace: <SLACK_WORKSPACE_NAME>
- create a
reviewers.yml
file in the root of your project. Please make sure to follow this format.
reviewers:
- githubName: roseline124
slackId: U07712R6TGS
name: hyunjisong
- githubName: roseline125
slackId: U07712R6TGS
name: leemonglyong
- githubName: roseline126
slackId: U07712R6TGS
name: hongkildong
You can customize the file path with the reviewers_file
input.
name: PR Slack Notification
on:
pull_request:
types: [opened, review_requested, closed]
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Notify Slack
uses: roseline124/codereview-action
with:
github_token: ${{ secrets.CODEREVIEWBOT_GITHUB_TOKEN }}
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_channel: <SLACK_CHANNEL_ID>
slack_workspace: <SLACK_WORKSPACE_NAME>
reviewers_file: <CUSTOM_FILE_PATH>
- about inputs
Input Name | Description | required | Default Value |
---|---|---|---|
github_token | add your github token | true | X |
slack_token | slack api > OAuth & Permissions > Bot User OAuth Token | true | X |
slack_channel | you can get channel id from slack channel link | true | X |
slack_workspace | get this input from <workspace_name>.slack.com | true | X |
reviewers_file | custom reviewers.yml file path | false | reviewers.yml |
slack_merge_emoji_name | merge emoji to attach to slack pr message | false | white_check_mark |
slack_close_emoji_name | close emoji to attach to slack pr message | false | x |
emergency_label_name | emergency label name. if this label exists, emergency message will be showed in slack | false | emergency |
language | set language you (ex. en , ko )want |
false | en |
- test action
act pull_request
(you need to install act)
- if you use colima,
sudo ln -s /Users/{username}/.colima/default/docker.sock /var/run/docker.sock
- set event like this
- pr open event:
act pull_request --eventpath event-open.json
- make changes
pnpm build
- commit & push
- if you push to
feature
branch: it release alpha tag (use alpha tag when testing)main
branch: it release version tag & bump up the version