Skip to content

Instantly share code, notes, and snippets.

@hamzahamidi
Last active October 5, 2020 22:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamzahamidi/3bf847eb676bfe07f9eaca9579fb9f41 to your computer and use it in GitHub Desktop.
Save hamzahamidi/3bf847eb676bfe07f9eaca9579fb9f41 to your computer and use it in GitHub Desktop.
github_repo="https://github.com/repo/repo.git"
TAGS=$(git ls-remote --refs --tags ${github_repo} | awk -F/ '{ print $3 }' | awk '{print $NF}')
LATEST_TAG=$(echo $TAGS | awk '{print $(NF-1)}')
echo $LATEST_TAG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment