readonly github repository

Hello,

I'm trying to setup my first build configuration with a private github repository.
I've created a vcs root for said repository using the username/access token way. (Github app won't work because my teamcity server is not public-facing)
The user has no write access to the repository. The token was created with the privileges:

  • repo:status
  • read:packages
  • read:org
  • read:public_key
  • read:user
  • user:email
  • read:project

Most of the vcs settings are default ones
However if I test the connection, teamcity wants to have write access:

Test connection failed in GithubTest / master
git -c core.askpass=/.../temp/pass13809968512572305903 -c credential.helper= ls-remote origin command failed.
exit code: 128
stderr: remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/...git/': The requested URL returned error: 403

Do I miss some settings or is it not possible for teamcity to "leech" code from github without write access?

Any help would be appreciated.

0
2 comments
Hi! TeamCity doesn't have to be accessible from the internet to create VCS Roots using the GitHub App connections.
That said, if you want to access a private repo using an access token, a token with the 'repo' scope is required.
0

Hello,

the 'repo' permission did the trick. Thank you.

(Seems the error message lead to a wrong conclusion.)

I'll test again the Github App approach, whenever I can find the time. 

For the future user: if 'origin' does not appear to be a git repository after changing the token for an existing vcs root, try Administration -> Diagnostics -> Caches -> git -> Reset or add the vcs root from scratch

0

Please sign in to leave a comment.