Created
May 19, 2021 14:54
-
-
Save phlax/93d0e4e38c431a7e7cb8e988b89b2329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Obtain latest release version and compare against metadata version, warn on | |
# mismatch. | |
def verify_and_print_latest_release(dep, repo, metadata_version, release_date): | |
try: | |
latest_release = repo.get_latest_release() | |
except github.GithubException as e: | |
# add a warning and make use of `e` | |
return | |
if latest_release.created_at > release_date and latest_release.tag_name != metadata_version: | |
print( | |
Fore.YELLOW | |
f'*WARNING* {dep} has a newer release than {metadata_version}@<{release_date}>: ' | |
f'{latest_release.tag_name}@<{latest_release.created_at}>' | |
Style.RESET_ALL) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment