Skip to main content

Configuring tag protection rules

You can configure tag protection rules for your repository to prevent contributors from creating or deleting tags.

Tag protection rules are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see "GitHub's products."

Note: Tag protection rules are currently in beta and subject to change.

When you add a tag protection rule, all tags that match the pattern provided will be protected. Only users with admin or maintain permissions in the repository will be able to create protected tags, and only users with admin permissions in the repository will be able to delete protected tags. For more information, see "Repository roles for an organization." GitHub Apps require the Repository administration: write permission to modify a protected tag.

Additionally, you can create custom repository roles to allow other groups of users to create or delete tags that match tag protection rules. For more information, see "Managing custom repository roles for an organization."

  1. On GitHub.com, navigate to the main page of the repository.
  2. Under your repository name, click Settings. Repository settings button
  3. In the "Code and automation" section of the sidebar, click Tags.
  4. Click New rule. New tag protection rule
  5. Under "Tag name pattern", type the pattern of the tags you want to protect. In this example, typing "*" protects all tags. Set tag protection pattern
  6. Click Add rule. Add tag protection rule