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

Unable to create/upload/publish because can't update draft #356

Open
pbrisbin opened this issue May 26, 2023 · 2 comments
Open

Unable to create/upload/publish because can't update draft #356

pbrisbin opened this issue May 26, 2023 · 2 comments

Comments

@pbrisbin
Copy link

We have a workflow where we create a draft release, then upload binaries (by OS) in a matrix, then publish the release. This action is creating a new release in the last step, instead of updating draft to false.

In publish, it creates the draft release as expected.

In upload, it finds the draft release and attaches the binaries to it as expected.

But in publish, it doesn't find the draft release, it creates a new one.

I'm particularly confused why upload works correctly, but publish does not.

There seems to be a few Issues,

And PRs,

In this area, but they're all multiple years old (is this action still maintained?), so I don't know if they're still applicable.

@pbrisbin
Copy link
Author

pbrisbin commented May 26, 2023

So it seems the bug is due to https://github.com/softprops/action-gh-release/blob/master/src/github.ts#LL204C30-L204C30

    // you can't get a an existing draft by tag
    // so we must find one in the list of all releases
    if (config.input_draft) {

The action will only find a draft release if input_draft. This means passing draft: true is the only way to find/update a draft release, which makes it kind of hard when you want to update it to draft: false! I think this is different from the Issues and PRs linked above -- at least, neither of the PRs seem to change this line to correct this behavior.

@pbrisbin
Copy link
Author

I opened #357, which solves this use-case for me.

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

1 participant