fabpot/local-php-security-checker

FR: have a release called "latest"

SpacePossum opened this issue · 3 comments

When downloading a binary in a CI/CD pipeline it would be ideal to always download the "latest" release.
The current latest is for example:

https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_darwin_amd64

Would be great to have something like:

https://github.com/fabpot/local-php-security-checker/releases/download/latest/local-php-security-checker_darwin_amd64

with the later URL always serving the latest release

Does anyone know how to do this, then I'm willing to provide a PR!

For now you could use (needs jq).

sudo curl -L $(curl -s https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest | jq -r '.assets[].browser_download_url | select(.|test("_linux_amd64$"))') -o /usr/local/bin/local-php-security-checker && sudo chmod +x /usr/local/bin/local-php-security-checker

Also see #10

That's really a Github issue, nothing we can fix ourselves. Solution from @gisostallenberg looks enough though.