Skip to content

Commit e65a62c

Browse files
authored
Merge pull request #16485 from github/oscarsj/fix-lfs-probe-auth-in-cs
make sure GITHUB_TOKEN exists and is not empty before using it in auth headers
2 parents a62ce4c + 9105faa commit e65a62c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

misc/bazel/internal/git_lfs_probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_endpoint():
6868
# see https://github.com/actions/checkout/blob/44c2b7a8a4ea60a981eaca3cf939b5f4305c123b/src/git-auth-helper.ts#L56-L63
6969
auth = git("config", f"http.{url.scheme}://{url.netloc}/.extraheader")
7070
endpoint.update_headers(get_env(auth, sep=": "))
71-
if "GITHUB_TOKEN" in os.environ:
71+
if os.environ.get("GITHUB_TOKEN"):
7272
endpoint.headers["Authorization"] = f"token {os.environ['GITHUB_TOKEN']}"
7373
if "Authorization" not in endpoint.headers:
7474
# last chance: use git credentials (possibly backed by a credential helper like the one installed by gh)

0 commit comments

Comments
 (0)