Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastlane Match failed to connect using personal access token and username

I'm having a bit of trouble connecting to a private repo in order to get the certs and profiles. Here is some of the code that is running in a fastlane lane within circle-ci job/workflow. I would imaging this would be possible because of here

username = ENV['USERNAME']
personal_github_access_token = ENV["PERSONAL_GITHUB_ACCESS_TOKEN"]
authorization_token_str = "#{username}:#{personal_github_access_token}"
basic_authorization_token = Base64.encode64(authorization_token_str)

match(
  git_basic_authorization:basic_authorization_token,
  type: "development",
  app_identifier: app_identifiers(),
  readonly: true
)

Error

[12:08:10]: Cloning remote git repo... [12:08:10]: If cloning the repo takes too long, you can use the clone_branch_directly option in match. Cloning into '/var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/d20191030-1122-178s7ae'... ERROR: Repository not found. fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. [12:08:10]: Exit status: 128 [12:08:10]: Error cloning certificates repo, please make sure you have read access to the repository you want to use [12:08:10]: Run the following command manually to make sure you're properly authenticated:

Thanks for your comments and answers. :)

like image 302
Lamour Avatar asked Oct 30 '19 19:10

Lamour


3 Answers

I have same problem and this works for me: Base64.strict_encode64

Found solution from here: https://github.com/fastlane/fastlane/issues/15682

like image 199
axumnemonic Avatar answered Oct 18 '22 01:10

axumnemonic


If you are using an OAuth token, make sure you are using git over https and not ssh.

Look in your Matchfile, it should be git_url("https://github.com/<user>/<repo>.git") and not git_url("[email protected]:<user>/<repo>.git")

If you need to use it over ssh, you need to configure a ssh key.

like image 25
Juan Avatar answered Oct 18 '22 01:10

Juan


This worked for me after the github changed started forcing me to use the github personal access token. I am pushing my code to testflight for beta testing

git_url("https://github.com/{github_username}/git_repo_name.git")
match(
  git_basic_authorization: Base64.strict_encode64("github_username:github_personal_token"),
  type: "appstore"
)
like image 4
Jose Avatar answered Oct 18 '22 02:10

Jose