我正在构建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
将回购设置为公开后,一切都会按预期进行。