jaxxstorm / action-install-gh-release

GitHub Action to install the Github Release binaries
Apache License 2.0
75 stars 32 forks source link

Install latest prerelease assets #92

Open pchalamet opened 2 months ago

pchalamet commented 2 months ago

Hello,

This is un unsolicited PR to allow finding the latest prerelease. action-install-gh-release only supports tags (with latest) but I need to support prerelease workflow. So here I go with this PR !

To enable this feature, one must set in configuration (README.md updated):

tag: latest # optional as this is the default
prerelease: true

Implementation notes:

Thanks!

jaxxstorm commented 1 month ago

This is great, thank you.

jaxxstorm commented 1 month ago

Can you add a test for this please?

pchalamet commented 1 month ago

done

image

pchalamet commented 1 month ago

Also, as this is an unsolicited PR, probably you would like to decide how to activate this feature. I quickly settle for prerelease flag but this might not be the greatest idea from a user point of view. latest is in no way used on GitHub api (but getLatestRelease) so maybe this worth considering to use a specific tag instead to enable this feature (latest-prerelease for example).

So basically, I see two choices:

  1. keep current provided implementation: tag: latest + prerelease: true
  2. use specific tag: tag: latest-prerelease

I'm leaning towards 2 after thoughts since it's probably less error prone (ex: keeping valid tag + enabling prerelease will lead to failure). The advantage of 1 is it's really easy to switch to prerelease.

It's up to you, let me know what you want to enable this feature, I will happily modify the PR accordingly.

jaxxstorm commented 1 month ago

I'm happy with this as it is, can you rebase and I'll merge?

pchalamet commented 1 month ago

done