Reputation: 333
I have a ci build that should push changes to the git repo. I am using a PowerShell script to execute git commands. However, it fails with:
You need the Git 'GenericContribute' permission to perform this action.
I have already enabled
Allow scripts to access OAuth token
However, that did not help. I am looking for a way to pass the Personal access token into the Powershell to be able to push to git. Below the error:
Upvotes: 1
Views: 1676
Reputation: 382
The message you've got back there indicates that the token has made it through to your script and onto the request operation you're performing, but the identity associated with the token is not authorised to push to the destination repository.
You'll need to either change the identity associated with the OAuth token, or grant the "Contribute" permission to that identity (or one of the groups in which it is a member) for the git repository you are trying to operate against.
Upvotes: 2