Skip to content

Support setting related fields for PRs and issues when creating #340

Description

@Nadock

Describe the feature or problem you’d like to solve

Add support to the gh pr create command to set fields like assignee, reviewers, labels, projects, etc for a new PR.

Proposed solution

Additional prompts in the "create wizard" and additional flags for non-interactive use.

It would benefits users as it would avoid the need to open the PR in a web browser after creating a PR in order to add the correct related fields for their PR.

Activity

  1. vilmibm commented on Feb 10, 2020

    @vilmibm
    Contributor

    We were just brainstorming this sort of thing last week :)

    we're trying to decide what the best UX for this is and as you suggest are considering enter-to-skip prompts to add those links.

  2. mtchavez commented on Feb 12, 2020

    @mtchavez

    This exists in https://github.com/github/hub with the following usage

    Usage: hub pull-request [-focpd] [-b <BASE>] [-h <HEAD>] [-r <REVIEWERS> ] [-a <ASSIGNEES>] [-M <MILESTONE>] [-l <LABELS>]
           hub pull-request -m <MESSAGE> [--edit]
           hub pull-request -F <FILE> [--edit]
           hub pull-request -i <ISSUE>
    

    Or how I usually do it with hub pull-request -l feature -r user1,user2,user3 -b staging

  3. wmccracken commented on Feb 13, 2020

    @wmccracken

    Just made my first PR with the new CLI tool. I think there is a ton of potential here! For me, at a minimum, having the ability to set a reviewer(s) would be really useful. As the tool stands now, I have to use the view command to open the PR up in the browser to set my reviewers.

  4. changed the title [-]Support setting related fields for PRs[/-] [+]Support setting related fields for PRs and issues[/+] on Feb 13, 2020
  5. casperdcl commented on Feb 14, 2020

    @casperdcl

    Could also have a gh pr edit purely for modifying labels/reviewers/assignees

    • avoids the overhead/inconvenience of specifying these on gh pr create/clicking Enter lots of times to keep them blank
    • can re-use logic for supporting additional flags in gh pr create
  6. aidansteele commented on Feb 15, 2020

    @aidansteele

    I was just about to submit a feature request until GitHub helpfully pointed out this issue. Here's what I was about to post:

    I use the tibdex/autosquash GitHub Action. It automatically merges PRs that have an autosquash label. My workflow is to run gh pr create, preview the PR in the browser, select the label and create the PR.

    I'd like to be able to instead invoke gh pr create --label autosquash and have the label automatically applied and remove the need to even open the browser. The benefit for me is that right now the added friction of having to leave the terminal and keyboard means that I don't make PRs as small as they could be.

  7. changed the title [-]Support setting related fields for PRs and issues[/-] [+]Support setting related fields for PRs and issues when creating[/+] on Feb 28, 2020
  8. fsmiamoto commented on Mar 20, 2020

    @fsmiamoto
    Contributor

    Right now, I feel the same but mostly with issues.
    I still have to use the browser to set the labels to keep my issues organized.

    This keeps me away from trying to master the CLI since I know the are some things I can't do with it

    I think an interface like the one @aidansteele suggested could work for issues as well

    gh issue create --label bug
    
  9. self-assigned this
    on Apr 10, 2020
  10. zinefer commented on Apr 20, 2020

    @zinefer

    Editing a pullrequest to either close or apply a label would make automating some housekeeping where I apply a label, close and delete the branch of a pullrequest.

  11. mislav commented on May 11, 2020

    @mislav
    Contributor

    Done in #787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLIneeds-designAn engineering task needs design to proceed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions