Get the latest release tag from a Github repository

Sometimes I needed to programmatically get the tag name of the latest release from a GitHub repository. It’s often useful for automating tasks through scripts or for creating installer CLIs. The GitHub public API provides this information, so you’ll get it using your shell. Define the repository in the REPO environment variable. This way it will be easier for you to try other repositories later. REPO='kubernetes/kubernetes' Now use curl to issue a request to the GitHub REST API.