Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit or update an existing release #1997

Closed
tunetheweb opened this issue Sep 27, 2020 · 10 comments
Closed

Edit or update an existing release #1997

tunetheweb opened this issue Sep 27, 2020 · 10 comments
Labels
enhancement a request to improve CLI help wanted Contributions welcome

Comments

@tunetheweb
Copy link

tunetheweb commented Sep 27, 2020

What to implement:

# Flags
gh release edit my-tag-123 --title "my updated title"  # short: -t
gh release edit my-tag-123 --notes "short notes"       # short: -n
gh release edit my-tag-123 --notes-file long_notes.md  # short: -f

# mark as published
gh release edit my-tag-123 --publish   # no short

# prerelease status
# This acts as a toggle.
gh release edit my-tag-123 --prerelease # no short

# Interactive mode
# Note the default for "Is this a prerelease" should reflect what is currently set so hitting enter changes nothing.
gh release edit my-tag-123
? Title (my cool release) my updated release title
? Notes [e to edit notes, enter to skip]
? Is this a prerelease? [Yn]
https://github.com/blah/blah/releases/tag/my-tag-123

Original feature request below.


Describe the feature or problem you’d like to solve

The release-drafter GitHub Action automatically creates a draft release and adds to it as each Pull Request is merged.

It would be good if GitHub CLI could tag that draft release, add assets, and publish it.

At present it appears (from my limited understanding!) that GitHub CLI 1) can only create a new release or update a previously tagged release and 2) cannot publish a release. Please let me know if I’m mistaken.

Proposed solution

Perhaps provide gh release publish option that would take the same arguments as gh release create but allow a way of specifying latest draft as the release to base this on?

This would allow users to manage releases better from command line and/or automated scripts.

@tunetheweb tunetheweb added the enhancement a request to improve CLI label Sep 27, 2020
@mislav
Copy link
Contributor

mislav commented Sep 28, 2020

Thanks for the suggestion! Agreed that this should definitely get possible in the future 👍

@tunetheweb tunetheweb changed the title Publish and existing draft release Publish an existing draft release Sep 28, 2020
@vilmibm vilmibm added the core This issue is not accepting PRs from outside contributors label Sep 29, 2020
@inktomi
Copy link
Contributor

inktomi commented Jan 28, 2021

This is the last missing link in using gh to manage releases for me. I'm excited to begin using gh - but need this in first as managing releases is one of my primary uses for this tool. We create a draft release, build a bunch of stuff, upload it all, then mark the release complete. It'd be great if that whole flow could be scripted!

@mislav mislav changed the title Publish an existing draft release Edit or update an existing release Feb 1, 2021
@mislav
Copy link
Contributor

mislav commented Feb 1, 2021

I have renamed this feature request to describe the more general feature of editing a Release, including changing its draft or pre-release status.

@peaceiris
Copy link

It will become a subcommand like hub release edit 👍

peaceiris added a commit to peaceiris/emoji-ime-dictionary that referenced this issue Jun 14, 2021
- Enable COMPOSE_DOCKER_CLI_BUILD DOCKER_BUILDKIT
- Replace hub with gh

The reason to use `gh release delete` is here: cli/cli#1997
@kzu
Copy link

kzu commented Aug 26, 2021

Sad to see no movement on this in almost a year 😢

@mingyjongo
Copy link

mingyjongo commented Feb 23, 2022

Bump! Could use this feature for my team and would love to hear any updates on prioritization here, even if it means it's off the table for the foreseeable future.

In case it helps anybody else, I'm currently working on a split flow in CI where a draft release is created in one step, artifacts are uploaded in another, and then a shell script will use the REST API to publish the draft. ((👈 this last part is annoying))

https://docs.github.com/en/rest/reference/releases#update-a-release

@samcoe samcoe added the discuss Feature changes that require discussion primarily among the GitHub CLI team label Feb 24, 2022
@vilmibm vilmibm added the needs-design An engineering task needs design to proceed label Mar 2, 2022
@vilmibm vilmibm self-assigned this Mar 2, 2022
@vilmibm
Copy link
Contributor

vilmibm commented Mar 2, 2022

Here are mockups for a gh release edit command.

# Flags
gh release edit my-tag-123 --title "my updated title"      # short: -t
gh release edit my-tag-123 --notes "short notes"           # short: -n
gh release edit my-tag-123 --notes-file long_notes.md  # short: -f

# mark as published
gh release edit my-tag-123 --publish   # no short

# prerelease status
# This acts as a toggle.
gh release edit my-tag-123 --prerelease # no short

# Interactive mode
# Note the default for "Is this a prerelease" should reflect what is currently set so hitting enter changes nothing.
gh release edit my-tag-123
? Title (my cool release) my updated release title
? Notes [e to edit notes, enter to skip]
? Is this a prerelease? [Yn]
https://github.com/blah/blah/releases/tag/my-tag-123

@vilmibm vilmibm added help wanted Contributions welcome and removed needs-design An engineering task needs design to proceed core This issue is not accepting PRs from outside contributors discuss Feature changes that require discussion primarily among the GitHub CLI team labels Mar 2, 2022
@vilmibm vilmibm removed their assignment Mar 2, 2022
@inktomi
Copy link
Contributor

inktomi commented Apr 1, 2022

I'm going to try working on this over the next few weeks, thank you for the spec, and I'll use https://docs.github.com/en/rest/reference/releases#update-a-release as a reference for the REST call.

@NewtonChutney
Copy link

Any further update? If the feature has been implemented already we can proceed to close this issue?

@samcoe samcoe closed this as completed Oct 28, 2022
@CB-TimLudwinski
Copy link

Any further update? If the feature has been implemented already we can proceed to close this issue?

It seems like changing prerelease and draft was implemented like this: --prerelease=false and --draft=false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI help wanted Contributions welcome
Projects
None yet
Development

No branches or pull requests

11 participants