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

Duplicate draft release created when published release with same name exists #37

Closed
daviwil opened this issue Jun 7, 2018 · 3 comments · May be fixed by dyna-dot/atom#6, restinpeaceinout/atom#171 or NOUIY/atom#746

Comments

@daviwil
Copy link
Contributor

daviwil commented Jun 7, 2018

Hi there! I'm trying to use this library to automatically create GitHub releases and upload assets as a CI step. I've noticed that when reuseRelease and reuseDraftOnly are true, a duplicate draft release gets created if there's already a published release by the same name.

Here's what I'm trying to accomplish:

  • Create a draft release for version v1.0.0 if one doesn't already exist and there's no published release by the same name
  • If a draft v1.0.0 release exists, update the release and replace its assets
  • If a published v1.0.0 release exists, don't create a new draft release for v1.0.0 and don't update existing assets

It doesn't seem possible to do this currently since using reuseRelease and reuseDraftOnly causes a new draft release to be created if one doesn't already exist with the same name.

Is this the intended behavior? If not, could I send a PR for a new parameter that will skip draft release creation if there's already a published release with the same name?

Thanks!

@daviwil
Copy link
Contributor Author

daviwil commented Jun 7, 2018

One thought I had for the name of such an option is skipIfPublished. Might try prototyping that and send a PR.

@marceloavf
Copy link
Collaborator

We could disable a draft release for v1.0.0 when there is a release v1.0.0 since you will never be able to publish this specific draft release because you can't duplicate tags in a final release/pre release.

But I'm thinking about the users that use the editRelease option to update this draft release tag to a new one before publishing it.

daviwil added a commit to daviwil/publish-release that referenced this issue Jun 7, 2018
This change adds a new `skipIfPublished` argument to the CLI and API to
indicate that a new release should not be created if a non-draft release
with the same tag already exists.

Fixes remixz#37.
@daviwil
Copy link
Contributor Author

daviwil commented Jun 7, 2018

Yeah, that's why I think it's better for there to be a parameter to explicitly opt in to the new behavior.

I've created #38 to add a new parameter for this, let me know what you think!

marceloavf pushed a commit that referenced this issue Jun 8, 2018
This change adds a new `skipIfPublished` argument to the CLI and API to
indicate that a new release should not be created if a non-draft release
with the same tag already exists.

Fixes #37.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants