Send a Slack message when too many pull requests are merged into one branch (say develop) but not yet into another (say main).
It counts merged pull requests in BASE...HEAD: merge commits titled Merge pull request #N ..., and squash merges or merge commits whose subject ends in (#N). Rebase-merged pull requests can't be detected and count only as commits. A pull request that merges BASE back into HEAD also counts as outstanding.
| Input | Required | Default | Description |
|---|---|---|---|
slackToken |
Yes | A Slack bot token that can post to every channel in slackChannel. |
|
slackChannel |
Yes | The channel or channels to post to, by name (#releases) or ID. See Posting to several channels. |
|
basehead |
No | main...develop |
The branches to compare, as BASE...HEAD. |
pullRequestThreshold |
No | 5 |
Post when at least this many pull requests are outstanding. Must be a positive integer. |
commitThreshold |
No | Deprecated alias for pullRequestThreshold, with the same at least rule. Despite the name, it always counted pull requests, not commits. |
|
token |
No | ${{ github.token }} |
A GitHub token with read access to the repository. Replaces the GITHUB_TOKEN env var that v1.0.x read. |
owner |
No | Current repository owner | The repository owner. |
repository |
No | Current repository name | The repository name. |
on:
push:
branches: [develop]
jobs:
outstanding-prs:
runs-on: ubuntu-latest
steps:
- uses: fishbrain/outstanding-pull-requests-action@<commit SHA> # v2.0.0
with:
slackToken: ${{ secrets.SLACK_BOT_TOKEN }}
slackChannel: '#releases'
basehead: main...develop
pullRequestThreshold: 10Action inputs are always strings, so YAML lists (slackChannel: ['#a', '#b']) are rejected by GitHub. Pass several channels in one string instead:
slackChannel: '#releases, #rutilus-chat'slackChannel: |
${{ secrets.OUTSTANDING_PRS_SLACK_CHANNEL }}
#rutilus-chatChannels are split on commas, whitespace and newlines. Duplicates post once, ignoring case and a leading #, so #releases and Releases are one channel. A channel given once by name and once by ID still gets two messages.
Every channel is tried even if one fails. The step fails afterwards if any post failed, naming each failed channel.
Requires Node 24.
npm ci
npm run lint
npm run typecheck
npm test
npm run build # writes dist/, which is gitignoreddist/ is never committed to main. It is built and committed only on release/vX.Y.Z branches, one per release.
- In a pull request, bump
versioninpackage.json(andpackage-lock.json, vianpm version <x.y.z> --no-git-tag-version). Merge it. - Run the Release workflow on
main(Actions → Release → Run workflow, orgh workflow run release.yml --ref main). It tests and builds the action, commitsdist/on top ofmainon a newrelease/vX.Y.Zbranch, tags that commitvX.Y.Z, and creates the GitHub release. Nobody should commit torelease/*branches by hand. If only the last step (creating the GitHub release) fails, re-running won't work because the tag already exists. Finish by hand withgh release create vX.Y.Z --verify-tag --generate-notes. - Copy the commit SHA from the workflow run's summary and update the pinned SHA in the terraform repo (
repositories/assets/outstanding-prs.yml). Consumer workflows are generated from there, so editing them directly gets overwritten.