cheton / github-release-cli

A command-line tool for managing release assets on a GitHub repository.
MIT License
72 stars 17 forks source link

Possible to discard a draft? #13

Closed chetbox closed 5 years ago

chetbox commented 5 years ago

If I create a draft with --draft can I then discard the draft using this library? I've experimented and haven't found a way to do it with the existing options.

cheton commented 5 years ago

This feature is not available in current release. I can modify the code that will allow you to delete a release if no files are specified.

Delete release assets if files specified

github-release delete \
  --owner cheton \
  --repo github-release-cli \
  --tag "v0.1.0" \
  archive.zip index.html "app.*"

Delete release if no files specified

github-release delete \
  --owner cheton \
  --repo github-release-cli \
  --tag "v0.1.0" \
cheton commented 5 years ago

It seems that only prerelease can be deleted by specifying the tag name, draft is not possible. You have to specify the release id to delete a draft.

cheton commented 5 years ago

Fixed in 1.3.0, now you delete a draft using the release id:

  1. List all releases

    $ github-release list --owner cheton --repo github-release-cli
    * tag_name="v1.3.0", name="v1.3.0", id=17995869
    * tag_name="v1.2.0", name="v1.2.0", id=17868010
    * tag_name="v1.1.0", name="v1.1.0", id=16558634
    * tag_name="v1.0.1", name="v1.0.1", id=15307313
    * tag_name="v1.0.0", name="v1.0.0", id=15036892
    * tag_name="v0.4.1", name="v0.4.1", id=11088835
    * tag_name="v0.4.0", name="v0.4.0", id=11080368
    * tag_name="v0.3.0", name="v0.3.0", id=5352113
    * tag_name="v0.2.2", name="v0.2.2", id=5349924
    * tag_name="v0.2.1", name="v0.2.1", id=5348639
    * tag_name="v0.2.0", name="v0.2.0", id=5348496
    * tag_name="v0.1.1", name="v0.1.1", id=5348396
    * tag_name="v0.1.0", name="v0.1.0", id=5348201
  2. Delete a release using the release id

    $ github-release delete \
    --token <token> \
    --owner cheton \
    --repo github-release-cli \
    --release-id 17995869
chetbox commented 5 years ago

This is really helpful. Thanks for your quick work on this!