JuliaPackaging / BinaryBuilder.jl

Binary Dependency Builder for Julia
https://binarybuilder.org
Other
392 stars 101 forks source link

Deploying to a private repo #1281

Closed whatsthecraic closed 9 months ago

whatsthecraic commented 1 year ago

Hey all,

I'm trying to find a way to deploy to a private repo. A solution has been already published here, involving password-less ssh, which I'm also considering.

I've tried a different approach in the meanwhile, using the GitHub token. The first issue I've found is that the Wizard only requests access to public repositories, but this seems to be undocumented. The second issue is that there is an expectation that an existing github token must be of 40 characters, what's the reason? When setting a non 40 chars token, the failure was also "silent", it does not print anything in the log. Furthermore, in my case the token consisted of 93 characters and it worked fine.

Work-around to skip the check on the token's length:

using BinaryBuilder
using GitHub

github_token = xxx
BinaryBuilder.Wizard._github_auth[] = GitHub.authenticate(github_token)
push!(ARGS, "--verbose", "--deploy=user/private_repo")

# Run the script
include("build-tarballs.jl")
fingolfin commented 1 year ago

GitHub tokens used to be quite different, the 40 char check probably is a historical artifact and could be removed. You could just submit a PR doing that?