This Husky pre-push hook skips CI checks when the current branch is linked to a GitHub draft pull request, allowing work-in-progress branches to be pushed freely. For all other branches (no PR or an open/ready PR), it enforces a full quality gate.
Flow:
- Resolves the current branch name via
git rev-parse. - Queries the GitHub API (via
gh) for the branch's associated PR draft status. - If draft → prints an informational message with the PR number and exits cleanly (
exit 0), bypassing all checks. - Otherwise → runs the full check suite via Turbo:
check-types,lint, andtest.