Protect tags

Allow only holders of git:PushProtectedTag to create, move or delete tags that match a pattern.

Last updated 18 November 2026View as Markdown

Once a rule exists, creating, moving or deleting a matching tag needs git:PushProtectedTag in addition to git:PushRepository: for example, so that only the release pipeline's role can cut a v1.2.3 that starts a production build. Replace v* with a tag name or glob.

Prerequisites

  • Permission for git:ManageBranchProtection on the repository.

Add a rule

Not available in Console. The Deutsche Cloud Console has no form for tag protection yet.

A pattern holds letters, digits and . _ / * + -, up to 200 characters; anything else is refused with Letters, digits and . _ / * + - only. A pattern that already has a rule is refused with 409 That pattern is already protected.

Result

A push that creates, moves or deletes a matching tag without git:PushProtectedTag is refused:

tag "v1.2.3" is protected (rule "v*"): you may not create or move it. Protected tags need git:PushProtectedTag.

A deploy key can never hold git:PushProtectedTag, so a push over a deploy key cannot create, move or delete a protected tag.

Remove a rule

List the rules with dcloud git tag-protection list to find the rule id, then remove it with dcloud git tag-protection delete or DELETE /git/api/repositories/{repoId}/tag-protection/{ruleId}.

Did this page help you?