Skip to content

Commit

Permalink
Don't fetch GitHub username for authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Nov 21, 2023
1 parent ad70f55 commit 8e73aa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/AutoBuild.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1581,13 +1581,12 @@ end
function push_jll_package(name, build_version;
code_dir = joinpath(Pkg.devdir(), "$(name)_jll"),
deploy_repo = "JuliaBinaryWrappers/$(name)_jll.jl",
gh_auth = Wizard.github_auth(;allow_anonymous=false),
gh_username = gh_get_json(DEFAULT_API, "/user"; auth=gh_auth)["login"])
gh_auth = Wizard.github_auth(;allow_anonymous=false))
# Next, push up the wrapper code repository
wrapper_repo = LibGit2.GitRepo(code_dir)
LibGit2.add!(wrapper_repo, ".")
commit = LibGit2.commit(wrapper_repo, "$(name)_jll build $(build_version)")
Wizard.with_gitcreds(gh_username, gh_auth.token) do creds
Wizard.with_gitcreds("x-access-token", gh_auth.token) do creds

Check warning on line 1589 in src/AutoBuild.jl

View check run for this annotation

Codecov / codecov/patch

src/AutoBuild.jl#L1589

Added line #L1589 was not covered by tests
refspecs = ["refs/heads/main"]
# Fetch the remote repository, to have the relevant refspecs up to date.
LibGit2.fetch(
Expand Down
5 changes: 2 additions & 3 deletions src/wizard/deploy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ end
function yggdrasil_deploy(name, version, patches, build_tarballs_content;
open_pr::Bool=false,
branch_name=nothing,
gh_auth = github_auth(;allow_anonymous=false),
gh_username=gh_get_json(DEFAULT_API, "/user"; auth=gh_auth)["login"])
gh_auth = github_auth(;allow_anonymous=false))
# First, fork Yggdrasil (this just does nothing if it already exists)
fork = GitHub.create_fork("JuliaPackaging/Yggdrasil"; auth=gh_auth)

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

0 comments on commit 8e73aa7

Please sign in to comment.