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

Print which release is latest #369

Closed
rfdonnelly opened this issue Feb 3, 2022 · 3 comments
Closed

Print which release is latest #369

rfdonnelly opened this issue Feb 3, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@rfdonnelly
Copy link

Is your feature request related to a problem? Please describe.

Hi. Thanks for sharing this Action. It does exactly what I need.

I'm fetching the "latest" release for my project and it would be nice to know exactly which release was fetched. When debugging a run, it is not always clear which release was the "latest" release at the time of the run.

Describe the solution you'd like

Something like:

 Run robinraju/release-downloader@v1.3
   with:
     repository: rfdonnelly/scma-gcal-sync
     latest: true
     fileName: scma-gcal-sync
     tarBall: false
     zipBall: false
     out-file-path: .
 Fetching latest release for repo rfdonnelly/scma-gcal-sync
 Downloading file: scma-gcal-sync to: /home/runner/work/scma-gcal-sync/scma-gcal-sync
+Downloaded release v1.2.0
 Done: /home/runner/work/scma-gcal-sync/scma-gcal-sync/scma-gcal-sync

Describe alternatives you've considered

I've considered manually printing the version information of the downloaded release (e.g. program --version) but details of how to implement this would be different for every project and it may not match the GitHub release. The GitHub release information is more authoritative.

@robinraju
Copy link
Owner

To fetch the latest release, I'm using the GH API repos/{repo-name}/releases/latest
I tried with the repo you've specified https://api.github.com/repos/rfdonnelly/scma-gcal-sync/releases/latest
It returns "tag_name": "v2.0.0-rc.3".

In short: it's doable!

@robinraju robinraju added the enhancement New feature or request label Feb 3, 2022
@robinraju
Copy link
Owner

@rfdonnelly I just merged a pr adding the requested change.

It now prints a log message as follows, if latest release is specified

Fetching latest release for repo robinraju/release-downloader-test
Found latest release version: v0.0.1

https://github.com/robinraju/release-downloader/runs/5057810179?check_suite_focus=true

You can test it on your repo using the action from main branch as follows.

- name: Download latest release
  uses: robinraju/release-downloader@main

This will be available in the next version of release-downloader.

rfdonnelly added a commit to rfdonnelly/scma-gsync that referenced this issue Feb 3, 2022
@rfdonnelly
Copy link
Author

Wow. Brilliant. Thank you!

Works great:

 Fetching latest release for repo rfdonnelly/scma-gcal-sync
+Found latest release version: v2.0.0-rc.3
 Downloading file: scma-gcal-sync to: /home/runner/work/scma-gcal-sync/scma-gcal-sync
 Done: /home/runner/work/scma-gcal-sync/scma-gcal-sync/scma-gcal-sync

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

No branches or pull requests

2 participants