Skip to content

Conversation

alexis-opolka
Copy link
Contributor

This PR allows users to upload to an already created release in draft mode.

It adds:

  • An input named draft_id
  • An output named draft_id

Since the issue to upload to a release in draft mode affects mostly those using a matrix we cannot integrate a complete logic inside this action.
What we can do however, is to "listen" to an ID and try to upload to it, this needs to already have a release ID before calling this action in draft mode which is honestly not really complicated to do. (see https://github.com/marketplace/actions/release-draft for a dedicated actions or @alexis-opolka/upload-release-action/master/.../draft-matrix.yml for an example using this action in two different jobs)

Fixes #133

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>
Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>
@alexis-opolka
Copy link
Contributor Author

@svenstaro Any review would be appreciated, let me know if there are changes to make. 😄

@alexis-opolka alexis-opolka changed the title Feat: Allow upload to draft release Feat: Allow upload to draft release using a matrix Mar 23, 2025
@yairm210
Copy link
Collaborator

I'm interested in solving this problem :)
If I understand correctly, you're saying that the Github search API doesn't return draft results, when we search by tag? So we must input the draft ID manually?

@alexis-opolka
Copy link
Contributor Author

alexis-opolka commented Jun 23, 2025

Hi @yairm210 ,
The last time I checked the REST API endpoint for releases it clearly mentioned published releases by tags so given that a draft is not yet published it is not returned by GitHub's API when fetching releases by tag.

The solution I found was to fetch the release by its ID but the issue was how to get the ID from one job to the other in the case of matrix jobs since they can run concurently. The best would be an automated way of doing it.

@yairm210 yairm210 merged commit dfdf376 into svenstaro:master Jun 30, 2025
3 checks passed
@yairm210
Copy link
Collaborator

Will create a release once I have tests in place to ensure validity

@yairm210
Copy link
Collaborator

Done, changing draft_id to release_id for consistency

@alexis-opolka
Copy link
Contributor Author

Alright, 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

Successfully merging this pull request may close these issues.

draft: true creates new releases for each asset uploaded by matrix build
2 participants