Commit status publisher using Access Token not working with Github
My attempts to get TeamCity to deploy commit status to a private github repo has starting failing:
```Error while retrieving "git@github.com:<>/<>.git" repository information: Failed to complete request to GitHub. Please check if the error is not returned by a proxy or caused by the lack of permissions. Status: HTTP/1.1 401 Unauthorized```
The key is new, and the same user owns the ssh key used for the (working) VCS root. In particular, i periodically get this email:
```
Hi @<user>,
On March 23rd, 2020 at 21:54 (UTC) your personal access token (teamcity) using curl/7.58.0 was used as part of a query parameter to access an endpoint through the GitHub API:
https://api.github.com/repositories/<>/git/refs/pull/97/head
Please use the Authorization HTTP header instead, as using the `access_token` query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation.
Depending on your API usage, we'll be sending you this email reminder on a monthly basis for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.
Visit https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param for more information about suggested workarounds and removal dates.
Thanks,
The GitHub Team
```
Is there a bug with the CSP plugin that it doesn't support auth headers? But if so, why aren't others reporting the same problem?
Please sign in to leave a comment.
Hello Francesco,
Speaking of the commit publisher not able to connect to GitHub; I was not able to reproduce this issue with bundled Commit Status Publisher feature enabled. Was there any third-party plugin used? What version of TeamCity do you use? Could you please provide the build log (you could do so via "Submit a request" form)?
In regards to the email GitHub sent, it mentions curl has been used; I have confirmed with the development team that none of the bundled plugins nor the core functionality do not use curl. Could that be related to some script connecting to the repository?
No other plugins, latest release of TC. You are right though, it had nothing to do with TC, i just generated a new key and this time it worked fine, no idea why the last one went bad.
Many thanks for checking that it doesnt use curl, that had me going in the completely wrong direction.
Cheers!
Hello Francesco,
That`s good to hear, thank you for your reply! Should the issue reproduce for you please feel free to reach out to us with a build log for a better context on Commit Publisher and we will make sure to check further.