微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用nodegit访问私有仓库

如何解决使用nodegit访问私有仓库

我正在构建github应用,并尝试使用nodegit访问和克隆私有存储库,

我收到404错误

在这里调用克隆函数

Git.Clone("https://x-access-token:"+installation_token+"@github.com/"+full_repo_name+".git",repository,cloneOptions).then(function(repo) {
  console.log('Repo clone done!') 
})

然后我从webhook上下文中获取了令牌+ full_repo_name:

const { token } = await context.github.auth({ type: "installation" })
const full_repo_name = context.payload.repository.full_name

将回购设置为公开后,一切都会按预期进行。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。