cli / cli/cli

gh pr create --fill fails with confusing error: could not compute title or body defaults: fatal: ambiguous argument

Open
#5,896 15 comments 4 reactions 0 assignees View on GitHub
bug gh-pr priority-2
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the bug

I got an error below when running `gh pr create --label skip-changelog --fill` from inside a github action.

It is quite weird because I got the impression that the same action worked fine previously so it might be a recent regression.

The effective error comes from git which is called by gh. I checked and the previous command was able to correctly push the code to the new branch, one that has the same nable as the local branch (`release/v0.9.0`).

Still, gh pr create failed ugly.

### Steps to reproduce the behavior

gh version 2.13.0

```
git push origin "release/${RELEASE_NAME}"
gh pr create --label skip-changelog --fill
# ^ that one fails
```

### Expected vs actual behavior

```
[release/v0.9.0 d4bff6f] Release v0.9.0
3 files changed, 8 insertions(+), 1 deletion(-)
remote:
remote: Create a pull request for 'release/v0.9.0' on GitHub by visiting:
remote: https://github.com/ansible/ansible-language-server/pull/new/release/v0.9.0
remote:
To https://github.com/ansible/ansible-language-server
* [new branch] release/v0.9.0 -> release/v0.9.0
could not compute title or body defaults: fatal: ambiguous argument 'origin/main...release/v0.9.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
/usr/bin/git: exit status 128
```

### Logs

Code: https://github.com/ansible/ansible-language-server/blob/main/tools/release.sh#L60
Effect: https://github.com/ansible/ansible-language-server/runs/7234603626?check_suite_focus=true

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.