-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggh-releaserelating to the gh release commandrelating to the gh release commandp3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
Running gh release download targeting a draft release errors in a confusing manner:
➜ gh release download v0.0.2 --archive=zip
Get "": unsupported protocol scheme ""
Affected version
Please run gh version and paste the output below.
Steps to reproduce the behavior
Steps to reproduce the behavior:
- Create a draft release
- Set it to use a tag that will be created when the release is published
- Save it but don't publish it
- Use the
gh release download -R org/repo <tag-from-step-2> --archive=zip - Watch the GitHub CLI throw the Get "": unsupported protocol scheme "" error
This occurs because we attempt to use the zipball_url, which is unmarshaled into an empty string here:
cli/pkg/cmd/release/download/download.go
Line 168 in 408e21e
| var archiveURL = release.ZipballURL |
> GET /repos/williammartin-test-org/test-repo/releases/212464261 HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: token ████████████████████
> Content-Type: application/json; charset=utf-8
> Time-Zone: Europe/Amsterdam
> User-Agent: GitHub CLI 2.68.0
...
{
"url": "https://api.github.com/repos/williammartin-test-org/test-repo/releases/212464261",
...
"tarball_url": null,
"zipball_url": null,
"body": ""
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggh-releaserelating to the gh release commandrelating to the gh release commandp3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic