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

Published release became draft after update #185

Closed
mahnunchik opened this issue Mar 11, 2022 · 13 comments
Closed

Published release became draft after update #185

mahnunchik opened this issue Mar 11, 2022 · 13 comments

Comments

@mahnunchik
Copy link

Describe the bug

Published release became draft after update.

To Reproduce

  1. Create draft release with release-action
  2. Publish it manually
  3. Update release with option allowUpdates: true
  4. Published release became draft

Expected behavior

It would be great to have option such changeDraftDuringUpdate to be able to keep release published during update.

- uses: ncipollo/release-action@v1
  with:
    tag: v${{ env.VERSION }}
    name: v${{ env.VERSION }}
    draft: true
    changeDraftDuringUpdate: false
    allowUpdates: true
    omitBodyDuringUpdate: true
    omitNameDuringUpdate: true
@ncipollo
Copy link
Owner

I'm not sure I completely understand your use case - why set draft to true if you want to have the action directly publish your release?

@mahnunchik
Copy link
Author

I'd like the following behaviour:

  • draft: true for the newly created release
  • keep status unchanged for already existed release, to have draft as draft and published release as published

@ilg-ul
Copy link

ilg-ul commented Mar 24, 2022

I just had a similar problem, I had a a full release, with lots of downloads, and I inadvertently triggered the publish action, (which normally starts as draft), so my release was turned to draft.

It would be nice to have a solution to avoid setting the draft flag on existing full releases.

@ncipollo
Copy link
Owner

Got it, thanks for providing more context. I'll add an option to avoid applying the draft flag if the release exists.

@ilg-ul
Copy link

ilg-ul commented Mar 24, 2022

I'll add an option to avoid applying the draft flag if the release exists.

In my opinion the default should be set to prevent damaging existing releases.

@ncipollo
Copy link
Owner

I'm not sure that I agree, a couple of reasons:

  1. That would be a breaking change to existing behavior which could screw up other folks workflows.
  2. In terms of API clarity, if draft is true I think it makes sense to assume the user expects the output to always be a draft (unless this new flag is set).

While this might not make sense for your workflow, I'd also argue there might be people out there who always want to revert it to a draft so they can review changes before making public.

@ilg-ul
Copy link

ilg-ul commented Mar 24, 2022

I don't know other folks workflows, but, as far as I was able to understand the GitHub workflow, there is no option in the web interface to change a final release back to draft, and this is for good reasons, since release artefacts, once published, are expected to remain available permanently. At least this is the usual assumption, that people can use links to download the artefacts forever.

In my case, inadvertently starting the action made all the artefacts invisible, and people using the STM32 Arduino IDE were no longer able to download the Arm toolchain.

Thus, in my opinion, the possibility to disable a final release is a bug, not a feature.

@ncipollo
Copy link
Owner

The behavior of the action is consistent with the GitHub API, if you provide the draft option to the update call, github will convert it to a draft (see https://docs.github.com/en/rest/reference/releases#update-a-release).

In any case, when I get a chance I will add this option. If you have a ton of repos and don't want to manually set the new property all the time you can fork the action and change the default.

@ilg-ul
Copy link

ilg-ul commented Mar 25, 2022

you can fork the action and change the default.

No problem, once you add this option I can update the repos, I use a template and I can easily re-generate the configurations.

Just make sure that the documentation warns the users on the danger of re-enabling the draft option.

@ilg-ul
Copy link

ilg-ul commented Mar 31, 2022

Can you help me understand how to configure the action to prevent the release from being turned into a draft once it was already marked as release?

@ncipollo
Copy link
Owner

Still working on getting the release cut haha. When it's out you will just need to set omitDraftDuringUpdate to true. This will prevent it from applying draft when the the action is updating a release.

@ncipollo
Copy link
Owner

Okay, this has been released now. You can either use v1 or v1.10.0. Here's an example of usage: https://github.com/ncipollo/actions-playground/blob/5acb9a06a29b0e0b21f2a03309efbef48fe3d63d/.github/workflows/tag.yml#L32

@ilg-ul
Copy link

ilg-ul commented Mar 31, 2022

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants