Fastlane Match 使用个人访问令牌和用户名无法连接

问题描述 投票:0回答:3

我在连接到私人仓库以获取证书和配置文件时遇到了一些麻烦。这是在 circle-ci 作业/工作流中的 fastlane 通道中运行的一些代码。我想这是可能的,因为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
)

错误

[12:08:10]: 克隆远程 git 仓库... [12:08:10]: 如果克隆仓库 时间太长,您可以使用

clone_branch_directly
选项 匹配。克隆到 '/var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/d20191030-1122-178s7ae'... 错误:找不到存储库。致命:无法从远程读取 存储库。

请确保您拥有正确的访问权限和存储库 存在。 [12:08:10]:退出状态:128 [12:08:10]:克隆错误 证书回购,请确保您具有读取权限 您要使用的存储库 [12:08:10]:运行以下命令 手动确保您已通过身份验证:

感谢您的评论和回答。 :)

fastlane circleci-2.0 fastlane-match
3个回答
9
投票

如果您使用的是 OAuth 令牌,请确保您是通过 https 而不是 ssh 使用 git。

看你的

Matchfile
,应该是
git_url("https://github.com/<user>/<repo>.git")
而不是
git_url("[email protected]:<user>/<repo>.git")

如果需要通过ssh使用,需要配置ssh key。


7
投票

在 github 更改开始迫使我使用 github 个人访问令牌后,这对我有用。我正在将我的代码推送到 testflight 进行 beta 测试

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"
)

3
投票

我有同样的问题,这对我有用:

Base64.strict_encode64

从这里找到解决方案:https://github.com/fastlane/fastlane/issues/15682

© www.soinside.com 2019 - 2024. All rights reserved.