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

Add id input to support publish updates #357

Closed
wants to merge 6 commits into from

Conversation

pbrisbin
Copy link

It's currently not possible to publish a release (update draft from true to false) through this action. That's because the action can only locate a draft Release to update if it iterates over them all, and it only does that if draft is true, which means it can't also be false to perform the desired update.

To get around this, I added an id input and used that to find the existing release when given. This means you can pass the output of running the action once (to create the release) as an input to running the action again (to publish it) and it will be found and updated correctly.

I also made it possible to omit tag_name when id is given, and re-use the existing release's. This makes so everything is optional if you're trying to update an existing release by id, which ensures you can update what you want and retain all other values as whatever they were.

`files.length == 0` means the input was empty, so including it in the
message just added confusing whitespace, as well as broke the grammar of
the sentence.
})) {
let release = response.data.find((release) => release.tag_name === tag);
if (release) {
return release;
Copy link
Author

@pbrisbin pbrisbin May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was super duper confusing to me. It seemed like, if you came through to find a draft release (because draft:true), you'd just return out from here when found, skipping all the logic below to update any of its fields. This means updating an existing draft release could only ever upload assets, it could not make any other changes. I don't know why you would want this and my PR changes this behavior. Now, if an existing release is found (no matter how) it is updated.

@pbrisbin
Copy link
Author

pbrisbin commented Aug 30, 2023

👋 ping on this.

Is this action still maintained, or should we look elsewhere / consider maintaining our fork? It would be a shame, as this action appears to be the best alternative listed for the now-deprecated "official" release actions.

@pbrisbin
Copy link
Author

Closing. We're going to just maintain and use our fork.

@pbrisbin pbrisbin closed this Oct 19, 2023
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

Successfully merging this pull request may close these issues.

None yet

1 participant