Nudge Pull Request Reviewers (Port Workflows)
In the following guide, we are going to create a Port workflow that sends a Slack message to nudge PR reviewers with a kind reminder.
Common use cases
- Faster merges: Remind reviewers of open PRs to reduce delays.
- Better code: Encourage timely reviews for quicker feedback.
- Smoother workflow: Prevent bottlenecks that hinder development progress.
Prerequisites
-
Install GitHub Ocean.
-
Set up a Slack app:
- Go to your Slack apps page.
- Create a new app or use an existing one.
- Add the
chat:writeBot Token Scope under OAuth & Permissions. - Install the app to your workspace and copy the Bot User OAuth Token (
xoxb-...). - Invite the bot to the target Slack channel.
Open Beta
Port workflows are currently in open beta and available to all users. Workflows may undergo changes without prior notice.
Add the Slack bot token secret
- Go to your portal's Settings page.
- Navigate to Credentials and click + Secret.
- Add a secret named
SLACK_BOT_TOKENwith the Bot User OAuth Token you copied above.
Build the workflow
The workflow has three nodes:
- Trigger - a self-service trigger that lets users select a pull request entity. When launched from the entity bolt menu, Port pre-fills the selected PR automatically.
- Fetch PR - calls Port's catalog API to retrieve the PR entity's properties (title, link, reviewers).
- Send Slack notification - posts a reminder message to your Slack channel using the fetched PR data.
To create the workflow:
- Go to the Workflows page of your portal.
- Click on the
+ Workflowbutton in the top-right corner. - Click on the
Skip to editorbutton. - Copy and paste the workflow JSON below into the editor to replace the example workflow.
Nudge PR reviewers workflow JSON (click to expand)
{
"identifier": "nudge_pr_reviewers",
"title": "Nudge PR Reviewers",
"icon": "Slack",
"description": "Remind PR reviewers about pending pull request reviews",
"nodes": [
{
"identifier": "trigger",
"title": "Nudge PR Reviewers",
"config": {
"type": "SELF_SERVE_TRIGGER",
"userInputs": {
"properties": {
"pullRequest": {
"title": "Pull Request",
"description": "Select the pull request to nudge reviewers for",
"type": "string",
"format": "entity",
"blueprint": "githubPullRequest"
}
},
"required": ["pullRequest"]
},
"contexts": [
{
"on": "ENTITY",
"userInput": "pullRequest"
}
]
}
},
{
"identifier": "fetch_pr",
"title": "Fetch Pull Request",
"config": {
"type": "WEBHOOK",
"url": "https://api.port.io/v1/blueprints/githubPullRequest/entities/{{ .outputs.trigger.pullRequest }}",
"method": "GET",
"synchronized": true
},
"variables": {
"entity": "{{ .result.response.data.entity }}"
}
},
{
"identifier": "send_slack_notification",
"title": "Send Slack Notification",
"config": {
"type": "WEBHOOK",
"url": "https://slack.com/api/chat.postMessage",
"method": "POST",
"synchronized": true,
"headers": {
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Bearer {{ .secrets.SLACK_BOT_TOKEN }}"
},
"body": {
"channel": "YOUR_SLACK_CHANNEL",
"text": "\n*Reminder: Pending Pull Request Review*\nThis PR needs your attention!\n\n*PR:* <{{ .outputs.fetch_pr.entity.properties.link }}|{{ .outputs.fetch_pr.entity.title }}>\n*Reviewers:* {{ .outputs.fetch_pr.entity.properties.reviewers }}\nReview PR: {{ .outputs.fetch_pr.entity.properties.link }}"
}
}
}
],
"connections": [
{
"sourceIdentifier": "trigger",
"targetIdentifier": "fetch_pr"
},
{
"sourceIdentifier": "fetch_pr",
"targetIdentifier": "send_slack_notification"
}
]
}
- Click
Saveto save the workflow.
Configure the workflow
In the send_slack_notification node, replace YOUR_SLACK_CHANNEL with the channel ID or name where you want to send the reminder (e.g. #pr-reviews).
Let's test it!
You can trigger the workflow in two ways:
- From the Self-service page: Go to the Self-service page, find Nudge PR Reviewers, click it, and select a pull request from the dropdown.
- From an entity: In the
githubPullRequestcatalog page, click the bolt (⚡) menu on any PR row and select Nudge PR Reviewers -- the PR is pre-filled automatically.
After execution, the assigned reviewers receive a Slack message similar to:
*Reminder: Pending Pull Request Review*
This PR needs your attention!
*PR:* <link to PR>
*Reviewers:* reviewer1, reviewer2
Review PR: https://github.com/...
Done! You can now send a reminder to PR reviewers using Port Workflows.