File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1- from datetime import datetime , MINYEAR
1+ import os
2+ from datetime import datetime , MINYEAR
23from github import Github , GitRelease , Repository , GithubException
34
45def get_latest_github_repo_version (repo ):
5- client = Github ()
6+ # check for a github token that may be used alongside the codeql cli to upload github results
7+ # this will limit rate limting 403 errors on checking codeql versions, as the request will be authenticated if possible.
8+ # by default codeql uses env var "GITHUB_TOKEN" to authenticate
9+ # https://codeql.github.com/docs/codeql-cli/manual/github-upload-results/
10+ access_token = os .getenv ('GITHUB_TOKEN' )
11+ client = Github (access_token ) if access_token != None else Github ()
612 repo = client .get_repo (repo )
713 releases = repo .get_releases ()
814 latest_release = get_latest_github_release (releases )
You can’t perform that action at this time.
0 commit comments