needs-you

Guides

GitHub

Get a card when GitHub is waiting on you: a review request, a deployment that needs your approval, CI that failed on your branch, a mention, or one of your PRs that is ready to merge, has changes requested, conflicts or failing checks. Each card clears itself once the condition goes away.

A small poller, needs-you-github, does this from one machine every 5 minutes, using that machine's gh login. Nothing on GitHub changes: no webhook, no app, no public endpoint.

Before you start #

Set up (3 commands) #

# 1. Install the poller (from GitHub with your gh login, or `install -m 755 integrations/github/needs-you-github ~/.local/bin/` from a checkout)
gh api -H 'Accept: application/vnd.github.raw' repos/tayharris/needs-you/contents/integrations/github/needs-you-github > ~/.local/bin/needs-you-github && chmod 755 ~/.local/bin/needs-you-github

# 2. See what it would post, without posting anything
~/.local/bin/needs-you-github --dry-run -v

# 3. Run it every 5 minutes
(crontab -l 2>/dev/null; echo '*/5 * * * * $HOME/.local/bin/needs-you-github >/dev/null  # needs-you-github') | crontab -

Prefer a systemd user timer or, on a Mac, a LaunchAgent? Use the files in integrations/github instead of step 3.

Check it works #

Within 5 minutes the cards from the dry run appear on your Mac. Each one has a link to the place you act (the PR's files, the run's "Review deployments" page, the failing check's logs) and, where it takes more than one action, numbered steps. When you merge, review or fix the thing, the card goes away on the next run.

Tune it #

Settings go in ~/.config/needs-you/env:

NEEDS_YOU_GITHUB_CONTEXTS=acme=work,my-user=personal   # which owner's cards are work or personal
NEEDS_YOU_GITHUB_EXCLUDE=acme/huge-monorepo            # owners or repos to ignore
NEEDS_YOU_GITHUB_REASONS=-mention,-assign              # turn reasons off (or list the ones you want)

The full list of cards, keys and settings is in integrations/github/README.md. If you have many open PRs, NEEDS_YOU_GITHUB_PR_DAYS (default 14) skips the ones nobody has touched lately, and at most 20 cards are open at once (NEEDS_YOU_GITHUB_MAX_CARDS).

When it doesn't post #

This page is docs/guides/github.md in the repo. View or edit it on GitHub.