Monitors your GitHub Pull Request pipeline and notifies you when all checks pass or any check fails.
Note
Currently works only on macOS.
You need two things:
npxwhich you can get with Node.jsgh(GitHub CLI) and you must be logged in- Install and auth: https://cli.github.com/ then run
gh auth status
- Install and auth: https://cli.github.com/ then run
Run:
npx zx https://raw.githubusercontent.com/icaromh/pr-check/main/pr-check.mjs org repo prTo automatically mark a draft PR as ready when all checks pass, add the --ready flag:
npx zx https://raw.githubusercontent.com/icaromh/pr-check/main/pr-check.mjs org repo pr --readyOk, that's long, so maybe create an alias:
alias prcheck='npx zx https://raw.githubusercontent.com/icaromh/pr-check/main/pr-check.mjs'
prcheck org repo pr
prcheck org repo pr --ready # Mark as ready when checks passMake it permanent by adding the alias to your shell profile (e.g. ~/.zshrc or ~/.bashrc).
org/repo/pr is your GitHub organization, repository, and pull request number. Example:
prcheck acme-inc better-db 123
prcheck acme-inc better-db 123 --ready # Mark as ready when checks passWhen you use the --ready flag, the script will:
- Monitor your PR's check runs as usual
- If all checks pass AND the PR is currently a draft β automatically mark it as "ready for review"
- If the PR is already open (not a draft) β just notify that checks passed
- If any check fails β won't mark as ready
Example workflow:
- Create a draft PR with your changes
- Run the monitor with
--readyflag:prcheck acme-inc better-db 456 --ready
- The script monitors all checks
- When all checks pass, it automatically converts your draft to "ready for review"
- You get a notification: "PR #456 marked as ready and all checks passed"
If you work often with an organization or a repository you can create more aliases:
alias prcheck='npx zx https://raw.githubusercontent.com/icaromh/pr-check/main/pr-check.mjs'
alias prcheck-acme='prcheck acme-inc'
alias prcheck-bdb='prcheck-acme better-db'
prcheck-acme foo 2 # Will check PR 2 for acme-inc/foo
prcheck-bdb 1 # Will check PR 1 for acme-inc/better-dbIf you have the script file locally:
npx zx pr-check.mjs org repo prOr with an alias pointing to the local file:
alias prcheck='npx zx /path/to/pr-check.mjs'
prcheck org repo prThe script will:
-
π Fetch the specified pull request
-
π Monitor all check runs every 20 seconds
-
π Display real-time status of each check with emojis:
- β Success
- β Failure
- π In Progress
- β© Skipped
- π« Cancelled
- β° Timed Out
- β Action Required
-
β° Track and display elapsed time
-
οΏ½ Optionally mark draft PR as ready (with
--readyflag) -
οΏ½π Show a macOS notification when complete
-
π Play a sound notification
-
Exit with status code:
0if all checks pass1if any check fails
Let the script run. A notification window and sound will alert you when all checks are complete or when a check fails.
# Fix bug in authentication flow
π https://github.com/acme-inc/better-db/pull/123
Checks:
----------------------------------
β
Build
β
Lint
β
Test
π Deploy Preview
β³ Not all checks are completed yet. Retrying in 20 seconds...
When complete:
# Fix bug in authentication flow
π https://github.com/acme-inc/better-db/pull/123
Checks:
----------------------------------
β
Build
β
Lint
β
Test
β
Deploy Preview
β° Took: 3m 42s
----------------------------------
π All checks are completed! π
β
PR #123 - All checks passed successfully
If using --ready flag with a draft PR:
----------------------------------
π All checks are completed! π
β
PR #123 - All checks passed successfully
π Marking PR #123 as ready for review...
β
PR #123 is now ready for review
Or if there's a failure:
# Fix bug in authentication flow
π https://github.com/acme-inc/better-db/pull/123
Checks:
----------------------------------
β
Build
β
Lint
β Test
β
Deploy Preview
----------------------------------
β Failures in the pipeline
β° Took: 2m 15s
β PR #123 has check failures
- macOS (for sound and notification support)
- Node.js (for npx)
- GitHub CLI (
gh) authenticated with appropriate repository access
If you get an error about gh not being installed:
brew install gh
gh auth loginIf you get permission errors, make sure your GitHub token has access to the repository:
gh auth status