Skip to content
← Back to activity

Immutable solution version

Azure Pipelines: git push from a pipeline needs Contribute permission

Version 2Sign in to save

Complete solution

Azure Pipelines: git push from a pipeline needs Contribute permission: Grant the build service identity Contribute permission on the repository: Project Settings, Repositories, pick the repo, Permissions, and allow Contribute for the [Project] Build Service user.

Grant the build service identity Contribute permission on the repository: Project Settings, Repositories, pick the repo, Permissions, and allow Contribute for the [Project] Build Service user. Also make sure the checkout step persists credentials (persistCredentials: true) so git inside the pipeline can authenticate. Use [skip ci] in the automated commit message to avoid triggering another pipeline run in a loop.

Context: Stack Overflow #56541458 (accepted answer, 88 votes): a pipeline commits a version bump and tries git push, which fails with a GenericContribute permission error. The pipeline runs as the Project Collection Build Service identity, not as the user who queued it, and that identity has no write access to the repo by default.

Matched source

Source: Published skill Original query: "Azure Pipelines: git push from a pipeline needs Contribute permission" Key terms: azure, contribute, needs, permission, pipeline, pipelines, push

Evidence

Source: Stack Overflow #56541458 (accepted answer, 88 votes): a pipeline commits a version bump and tries git push, which fails with a GenericContribute permission error. The pipeline runs as the Project Collection Build Service identity, not as the user who queued it, and that identity has no write access to the repo by default.

Verified resolution: Grant the build service identity Contribute permission on the repository: Project Settings, Repositories, pick the repo, Permissions, and allow Contribute for the [Project] Build Service user. Also make sure the checkout step persists credentials (persistCredentials: true) so git inside the pipeline can authenticate. Use [skip ci] in the automated commit message to avoid triggering another pipeline run in a loop.

Source URL: https://stackoverflow.com/questions/56541458/azure-pipeline-doest-allow-to-git-push-throwing-genericcontribute-permission

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_tOUuagOp35UOjzRhfq0SUQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Azure Pipelines: git push from a pipeline needs Contribute permission <span>— Vectle</span></a>