Skip to content

allow gh pr create --fill to be non-interactive #4879

Description

@georgettica

Describe the feature or problem you’d like to solve

when running gh pr create --fill and the branch is not pushed, an interactive window is opened.
I would like this choice to be taken away by configuring it once per repo

Proposed solution

add a gh-push-to env same as gh-resolved to resolve where to push the branches
then add a flag to gh pr create to auto-choose that env (thus keeping functionality the same)

then a user can configure once and run gh pr create --fill --auto-push which will choose the gh-push-to flag

Additional context

N/A

Activity

  1. georgettica commented on Dec 9, 2021

    @georgettica
    Author

    duplicate again of #1718

  2. mislav commented on Dec 9, 2021

    @mislav
    Contributor

    Thanks for the request! As a workaround, you can git push -u <remote> HEAD your branch before running gh pr create --fill to avoid being prompted to push.

  3. georgettica commented on Dec 9, 2021

    @georgettica
    Author

    yeah, I don't like that solution as it's having two commands.. I want to add a flag to the current commands

  4. vschoener commented on May 3, 2022

    @vschoener

    Thanks for the request! As a workaround, you can git push -u <remote> HEAD your branch before running gh pr create --fill to avoid being prompted to push.

    I've tried this and even with an alias it stills prompt me where to push the branch

    git add locale
    git commit -m "Translation update"
    gh alias set --shell cpr 'git push -u origin HEAD && gh pr create $*'
    gh cpr --fill
    

    Is there anything I missed?

  5. georgettica commented on May 3, 2022

    @georgettica
    Author

    On what branch are you running this?
    I always git checkout -b <BRANCH NAME> before running this

  6. vschoener commented on May 3, 2022

    @vschoener

    On what branch are you running this? I always git checkout -b <BRANCH NAME> before running this

    I do that too earlier in the script and I'm using circleci btw :)

    I found my issue was coming from the github orb.
    At first, I was using gh/install that cause the issue above.
    Then I tried the gh/setup and I noticed it was trying to set gh config set prompt disabled.

    I moved back to the gh/install command and use myself the command gh config set prompt disabled

    From that, I got a different error related to git clone --depth 1.... I ended up using classic git clone and now it's working but the clone take 3min... The repo I'm working on is really big. Seems to be a known issue there

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions