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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benefit from the GitHub API to get latest released version binary #2330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

C-Duv
Copy link

@C-Duv C-Duv commented May 25, 2022

I noticed the example of command to get the static-compiled binary requires to manually type in the desired version.

This PR changes the command to automatically get the latest version from the GitHub API thus avoiding:

  • User manipulation
  • Updates to the README when a new version is released

Community Note

  • Please vote on this pull request by adding a 馃憤 reaction to the original pull request comment to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request
NONE

The documentation gives an example of command to fetch the static-compiled binary release but it implies to provide the version number in the `VERSION` variable and ask the user to go to a GitHub webpage to get this version number.

While it is convenient to allow manually specifying a version to download there is a unattended solution: The GitHub API.

This commit changes the default command to fetch the version of the latest released binary from the GitHub API via the following endpoint:
`https://api.github.com/repos/scaleway/scaleway-cli/releases/latest`

Manually providing a version is still documented.
@C-Duv
Copy link
Author

C-Duv commented Oct 13, 2022

What do I need to to do fix this documentation-only PR?

@remyleone
Copy link
Member

$ curl --no-progress-meter "https://api.github.com/repos/scaleway/scaleway-cli/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' | cut -c 2-
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
curl: (23) Failure writing output to destination

@remyleone remyleone added documentation priority:low Low priority such as UX improvements and esthetics labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation priority:low Low priority such as UX improvements and esthetics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants