【问题标题】:Fastlane Match failed to connect using personal access token and usernameFastlane Match 无法使用个人访问令牌和用户名连接
【发布时间】:2019-10-30 19:41:44
【问题描述】:

我在连接到私人存储库以获取证书和配置文件时遇到了一些麻烦。这是在 circle-ci 作业/工作流中的快车道上运行的一些代码。我想这可能是因为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 repo... [12:08:10]: 如果克隆 repo 时间太长,您可以使用clone_branch_directly 选项 匹配。克隆到 '/var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/d20191030-1122-178s7ae'... 错误:未找到存储库。致命:无法从远程读取 存储库。

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

感谢您的 cmets 和回答。 :)

【问题讨论】:

  • 你解决了吗?

标签: fastlane circleci-2.0 fastlane-match


【解决方案1】:

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

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

【讨论】:

  • Base64.strict_encode64 是什么意思?您能否详细说明您为解决该错误所采取的步骤?
  • 对不起,我不能给你详细的步骤,因为它可能超出了这个线程的上下文。它是 fastlane 提供的一个未记录的功能。如果你想使用 Fastlane Match,你必须提供git_basic_authorization 令牌。要获得该令牌,您必须提供usernamepersonal token,然后使用Base64.strict_encode64 对其进行编码。有关更多信息,请参阅上面的链接。
  • 感谢您的回答。目前该链接背后确实没有更多信息。对于未来的读者,您需要该密钥是您的 GitHub 用户名和密码或个人访问令牌(如果激活 2FA),并获得 Base64 编码值,例如javascriptbtoa('UNAME:PWorPAT')。如果编码值不正确,则会出现could not read Username 错误,即match 无法验证github.com/fastlane/fastlane/issues/…
【解决方案2】:

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

【讨论】:

  • 感谢您给出明确的答复。每个人似乎都认为每个人都知道 git basic auth 是如何创建的。
  • 是的,大多数时候我的感觉都是一样的,如果人们给出更多的上下文以及答案,它将帮助更多的人并为其他人节省很多时间。
【解决方案3】:

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

查看您的Matchfile,它应该是git_url("https://github.com/<user>/<repo>.git") 而不是git_url("git@github.com:<user>/<repo>.git")

如果你需要通过 ssh 使用它,你需要配置一个 ssh 密钥。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-02
    • 2021-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多