-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Open
Labels
bugSomething isn't workingSomething isn't workinggh-prrelating to the gh pr commandrelating to the gh pr commandp3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
I have a shell script that is run as part of a GitHub Actions workflow that, on occasion, clones a repository, creates, commits to, and pushes a branch, and then creates (or at least tries to) a pull request for the branch using gh pr create. However, gh is failing with "aborted: you must first push the current branch to a remote, or use the --head flag" despite the fact that the command immediately before it is "git push -u origin "$branch_name" (tried with & without the -u option).
- The repository is public.
- The remote URL used to check out the repository is of the form
https://x-access-token:$GITHUB_TOKEN@github.com/$OWNER/$REPO, where the same token is also set as the$GITHUB_TOKENenvironment variable. - The command succeeds if the
--headoption is used.
ozyx
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggh-prrelating to the gh pr commandrelating to the gh pr commandp3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic