Skip to content
All posts

Post open PRs to Slack with GitHub Actions, and when to outgrow it

A working GitHub Actions workflow that posts open PRs to Slack each weekday morning, plus what a list of open PRs cannot tell you.

A scheduled GitHub Actions workflow can post your open PRs to Slack with no extra service. It runs gh pr list on a weekday cron, formats the result with jq and sends it to a Slack incoming webhook. The full workflow is below. It is also a list of titles, which stops helping the moment the question changes from "what is open" to "what needs me."

Why post open PRs to Slack on a schedule?

GitHub's notifications are built around the individual: you hear about a PR when you are assigned, mentioned or asked to review. Nobody gets the shared view of what is open right now, what has no review and what has sat for days.

A morning post in a channel gives the whole team that view without anyone opening the pull requests tab. For a team of humans opening a handful of PRs a day, that covers the need.

The pressure comes from the idea behind this blog: AI-native teams create context faster than people can sync, manage or remember it. Say 40 PRs are open on a Wednesday morning, most opened by agents. A list of 40 titles is accurate and nobody reads it. Build the digest anyway, because it is cheap, and read the last sections to see where it stops.

How do you set up the Slack side?

  1. Create a Slack app for your workspace and turn on Incoming Webhooks.
  2. Add a webhook to the channel that should receive the digest. Slack gives you a URL.
  3. In your GitHub repository, go to Settings, then Secrets and variables, then Actions, and add the URL as a secret named SLACK_WEBHOOK_URL.

Treat the URL like a password: anyone who has it can post to that channel. Keep it in secrets and never in the workflow file.

What does the workflow look like?

Create .github/workflows/open-pr-digest.yml on your default branch. Scheduled workflows only run from the default branch, so a copy sitting on a feature branch never fires.

name: Open PR digest
 
on:
  schedule:
    - cron: "0 14 * * 1-5"
  workflow_dispatch:
 
permissions:
  contents: read
  pull-requests: read
 
jobs:
  digest:
    runs-on: ubuntu-latest
    steps:
      - name: Build and post the digest
        env:
          GH_TOKEN: ${{ github.token }}
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
          REPO: ${{ github.repository }}
        run: |
          gh pr list --repo "$REPO" --state open --limit 50 \
            --json number,title,url,author,isDraft,reviewDecision,updatedAt \
            --jq '[.[] | select(.isDraft | not)] | sort_by(.updatedAt)' > prs.json
 
          COUNT=$(jq length prs.json)
          if [ "$COUNT" -eq 0 ]; then
            echo "No open PRs, nothing to post."
            exit 0
          fi
 
          LINES=$(jq -r '.[] |
            "• <\(.url)|#\(.number) \(.title | gsub("&";"&amp;") | gsub("<";"&lt;") | gsub(">";"&gt;"))> by \(.author.login), \(if (.reviewDecision // "") == "" then "no review yet" else .reviewDecision end), updated \(.updatedAt[:10])"' prs.json)
 
          PAYLOAD=$(jq -n \
            --arg head "*Open PRs in $REPO: $COUNT*" \
            --arg body "$LINES" \
            '{text: ($head + "\n" + $body)}')
 
          curl -sS -X POST \
            -H 'Content-type: application/json' \
            --data "$PAYLOAD" \
            "$SLACK_WEBHOOK_URL"

What each part does:

  • cron: "0 14 * * 1-5" runs at 14:00 UTC, Monday to Friday. GitHub schedules in UTC, so convert from your team's morning.
  • workflow_dispatch adds a Run workflow button, so you can test without waiting for the schedule.
  • permissions keeps the built-in token read-only.
  • gh pr list ships on GitHub-hosted runners and uses the built-in token, so you add no credentials for GitHub.
  • The first jq filter drops drafts and sorts by last update, so the stalest PR comes first.
  • The second jq filter escapes the three characters Slack treats as markup and writes each PR as a Slack link with author, review state and last update date.
  • The empty check keeps the channel quiet when nothing is open. A digest that posts "0 open PRs" every morning trains people to ignore it.

Run it once with the Run workflow button and look at the channel. Links should open the right PRs, a title containing & should render as text, and the time should land before your main time zone starts work. Leave it for a week. If people reply in the thread or click through, keep it. If it collects an emoji reaction and nothing else, the list is too long or too late.

How do you cover more than one repository?

The built-in token only reaches the repository the workflow runs in. For several repos, create a fine-grained personal access token or a GitHub App token with read access to pull requests, store it as a secret, and loop over a list of repo names in the script. Post one message per repo, or one message with a heading per repo, whichever your team reads.

How do you keep the list short enough to read?

The fields that earn their place are the PR link, who opened it, the review state and the last update date. Together they answer four things: what it is, whose it is, whether anyone is on it, and whether it is making progress. Skip labels, line counts and the full description. They lengthen each line without helping anyone decide what to open.

The bigger lever is the filter. Instead of every open PR, post only the ones that need a person. Change the first jq filter in the workflow to keep PRs with no review decision that have not been updated in two days:

--jq '[.[] | select(.isDraft | not)
  | select((.reviewDecision // "") == "")
  | select(.updatedAt < (now - 172800 | todate))]
  | sort_by(.updatedAt)'

That turns the digest from an inventory into a short queue. Add a line at the top with the count, so a reader knows the size before reading any title. If the filtered list is empty, the workflow stays quiet, which is the right outcome.

What can a list of open PRs not tell you?

A PR list answers "what is open." It cannot answer "what changed that I need to act on" or "does this merge match what we decided." Use this table to spot the question your list is failing, and the cheapest change for each.

Question the list cannot answerWhy a list failsWhat to change
What does this PR actually change?Titles do not carry intentAdd a one-line summary, or read descriptions and diffs elsewhere
Which of these needs a human decision?Every PR looks the same in a listFilter to no-review and stale, as above
Did we already decide this in Slack?PR data has no link to the thread that caused itKeep a decision log and link PRs to it
Who owns the action on a stale PR?The channel is shared, so nobody isRoute stale PRs to their reviewers instead of the channel
What merged while I was out?The list shows open work, not merged workAdd a second post for merged PRs, or read a briefing
Is anyone reading this?Posting is not readingCount thread replies for two weeks, and cut the post if there are none

If three or more rows describe your team, the digest has done its job and the problem has moved from visibility to judgment. Our guide to posting PR summaries to Slack covers the merge-triggered version and its volume limit, and the post on routing GitHub updates by audience covers who should get what.

Where does Biddle fit?

Biddle starts where the PR list stops: it reads GitHub (PRs, reviews, CI and a diff excerpt of about 6 KB per PR), Slack and the tools your team connects, and tells the leader what needs a decision instead of listing everything that is open. It is in closed beta and runs every weekday for Liouville Labs' own team, with a morning DM for the leader, a team note in #askbiddle, a morning note for each teammate and a live dashboard of where the work stands. The GitHub App is read-only, and between briefings Biddle can DM a teammate when a PR is waiting on their review. You can see how the pieces connect in how it works, and if a list of open PRs has stopped telling you what needs you, join the waitlist and we'll set it up with you.

Common questions

Can I post from Actions without a Slack app?

You need some way into Slack. An incoming webhook is the simplest, and it requires a Slack app. A bot token also works if you want to post to several channels or send DMs.

Why did my scheduled workflow never run?

Schedules only fire from the default branch, and cron times are UTC. Merge the workflow file to the default branch and check the time conversion first.

Should I include draft PRs?

Leave them out of the shared post. Drafts are the author's work in progress, and listing them makes the digest longer without asking anyone to act.

Know where the work stands.

Closed beta. We set up each team with you.

Join the waitlist