Skip to content

Commit

Permalink
Move CodeQL latest version query behind CLI arg
Browse files Browse the repository at this point in the history
  • Loading branch information
travisgosselin committed Dec 7, 2022
1 parent 4632664 commit 1f14cff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions container/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ def get_latest_codeql(args):
codeql = CodeQL(CODEQL_HOME)
current_installed_version = codeql.get_current_local_version()
logger.info(f'Current codeql version: {current_installed_version}')
latest_online_version = codeql.get_latest_codeql_github_version()
if current_installed_version != latest_online_version.title and args.check_latest_cli:
# we got a newer version online, download and install it
codeql.download_and_install_latest_codeql(latest_online_version)
# ensure we only query for the latest codeql cli version if we might actually update it
if args.check_latest_cli:
latest_online_version = codeql.get_latest_codeql_github_version()
if current_installed_version != latest_online_version.title:
# we got a newer version online, download and install it
codeql.download_and_install_latest_codeql(latest_online_version)
# get the latest queries regardless (TODO: Optimize by storing and checking the last commit hash?)
if args.check_latest_queries:
codeql.download_and_install_latest_codeql_queries()
Expand Down

0 comments on commit 1f14cff

Please sign in to comment.