Skip to content

Commit 3bdbf48

Browse files
authored
Don't fetch GitHub username for authentication (#1305)
1 parent ad70f55 commit 3bdbf48

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/AutoBuild.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,13 +1581,12 @@ end
15811581
function push_jll_package(name, build_version;
15821582
code_dir = joinpath(Pkg.devdir(), "$(name)_jll"),
15831583
deploy_repo = "JuliaBinaryWrappers/$(name)_jll.jl",
1584-
gh_auth = Wizard.github_auth(;allow_anonymous=false),
1585-
gh_username = gh_get_json(DEFAULT_API, "/user"; auth=gh_auth)["login"])
1584+
gh_auth = Wizard.github_auth(;allow_anonymous=false))
15861585
# Next, push up the wrapper code repository
15871586
wrapper_repo = LibGit2.GitRepo(code_dir)
15881587
LibGit2.add!(wrapper_repo, ".")
15891588
commit = LibGit2.commit(wrapper_repo, "$(name)_jll build $(build_version)")
1590-
Wizard.with_gitcreds(gh_username, gh_auth.token) do creds
1589+
Wizard.with_gitcreds("x-access-token", gh_auth.token) do creds
15911590
refspecs = ["refs/heads/main"]
15921591
# Fetch the remote repository, to have the relevant refspecs up to date.
15931592
LibGit2.fetch(

src/wizard/deploy.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ end
147147
function yggdrasil_deploy(name, version, patches, build_tarballs_content;
148148
open_pr::Bool=false,
149149
branch_name=nothing,
150-
gh_auth = github_auth(;allow_anonymous=false),
151-
gh_username=gh_get_json(DEFAULT_API, "/user"; auth=gh_auth)["login"])
150+
gh_auth = github_auth(;allow_anonymous=false))
152151
# First, fork Yggdrasil (this just does nothing if it already exists)
153152
fork = GitHub.create_fork("JuliaPackaging/Yggdrasil"; auth=gh_auth)
154153

@@ -188,7 +187,7 @@ function yggdrasil_deploy(name, version, patches, build_tarballs_content;
188187
@info("Committing and pushing to $(fork.full_name)#$(branch_name)...")
189188
LibGit2.add!(repo, rel_bt_path)
190189
LibGit2.commit(repo, "New Recipe: $(name) v$(version)")
191-
with_gitcreds(gh_username, gh_auth.token) do creds
190+
with_gitcreds("x-access-token", gh_auth.token) do creds
192191
LibGit2.push(
193192
repo,
194193
refspecs=["+HEAD:refs/heads/$(branch_name)"],

0 commit comments

Comments
 (0)