Skip to content

Instantly share code, notes, and snippets.

@MalikBagwala
Last active September 29, 2025 14:53
Show Gist options
  • Select an option

  • Save MalikBagwala/2aac65bee5c8894988f7c0d2b10a2910 to your computer and use it in GitHub Desktop.

Select an option

Save MalikBagwala/2aac65bee5c8894988f7c0d2b10a2910 to your computer and use it in GitHub Desktop.

🛠️ Pull Request Creation with gh CLI

1. Get Metadata

  • Reviewers / Assignees:
gh repo view --json assignableUsers
  • Labels:
gh repo view --json labels

2. Format the PR Title

Use this format:

[<LINEAR-ID>] - <AUTHOR> - <TITLE>
  • LINEAR-ID — Extract from the current branch (e.g., DOC-4225).
  • AUTHOR — Your name (e.g., Malik).
  • TITLE — From branch name or latest commits.

Example:

[DOC-4225] - Malik - Fix timeline header click handler for template editing

3. Write the PR Description

  • Keep under 100 words.
  • Summarize what and why (pull from commit messages or branch name).
  • High-level and concise.

Example:

Fixes the timeline header click issue when editing templates. Updates the event handler to avoid unintended state changes.


4. Create the PR

Rules for reviewers:

  • Always include Victor.
  • Add two additional random reviewers from the assignable users list (excluding lucchaissac).

Example command:

gh pr create \
  --title "[DOC-123] - Malik - Improve focus logic" \
  --body "Brief summary under 100 words" \
  --fill-verbose \
  --reviewer victor,alice,bob \
  --assignee @me \
  --label bug \
  --head <current-branch>

(Replace alice,bob with any two random reviewers except lucchaissac.)


✅ Extra Tips

  • Use --fill or --fill-verbose to auto-populate PR body from commits/branch.
  • Add --draft if PR isn’t ready for review.
  • Use --base <branch> if not merging into the main/default branch.
  • Preview before submitting with --web (opens the PR in a browser).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment