使用nodegit访问私有仓库

时间:2020-10-24 22:48:07

标签: nodegit github-app

我正在构建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

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

0 个答案:

没有答案