Skip to content

Add tag protection policy documentation to repository.readme.md#38

Merged
david3107 merged 4 commits into
mainfrom
copilot/add-tag-settings-to-readme
Dec 23, 2025
Merged

Add tag protection policy documentation to repository.readme.md#38
david3107 merged 4 commits into
mainfrom
copilot/add-tag-settings-to-readme

Conversation

Copilot AI commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

The tag protection policy configuration was undocumented in repository.readme.md, despite being implemented in TagProtectionChecks.ts and present in repository.yml.

Changes

  • repository.readme.md: Added Tag Protection section documenting all configuration options

    • enforcement: active/disabled/evaluate modes
    • scope: include/exclude patterns with wildcard and ~ALL token support
    • operations: create/update/delete restrictions
    • naming: pattern matching operators (starts_with, ends_with, contains, regex)
    • bypass: actor configuration for org admins, teams, integrations, repository roles, deploy keys
  • repository.threats.md: Added threat model for unauthorized tag modification/deletion

    • Security controls for tag protection
    • SLSA.dev threat mappings: Submit unauthorized change, Upload modified package
    • MS DevOps threat matrix: Persistence, Privilege escalation

Example configuration:

tags:
  enforcement: active
  scope:
    include:
      - "v*"
    exclude:
      - "v*-rc*"
      - "v*-beta*"
  operations:
    create: restricted
    update: restricted
    delete: restricted
  naming:
    enabled: true
    operator: regex
    pattern: "^v\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"

Documentation follows existing format used for branch protection, actions, and other policies.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Tag settings to repository.readme.md</issue_title>
<issue_description>Add the description of how to use the tag policy into repository.readme.md following the same format used in the file

# define the protected tags for the repository
tags:
  enforcement: active           # disabled | active | evaluate
  target: tag                   # fixed for tag rules so we can also not specify it here but fix it in code

  scope:
    include:
      - "v*"                    # e.g., protect all version tags
      # - "~ALL"                # special token: all tags
    exclude: []                 # patterns to exclude, e.g., ["v0.*"]

  operations:                   # who can perform actions on matching tags
    create: restricted          # allowed | restricted (restricted = bypass-only)
    update: restricted
    delete: restricted

  naming:                       # optional: constrain tag names
    enabled: true
    operator: regex             # starts_with | ends_with | contains | regex
    pattern: "^v\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
    negate: false               # true = pattern disallowed

  bypass:                       # actors allowed to bypass protections
    organization_admins: always # always | exempt
    teams:
      - id: 1234567             # example team id
        mode: always            # always | exempt
    integrations:
      - id: 987654              # GitHub App id
        mode: always
    repository_roles:
      - id: 3                   # e.g., Maintainer role id
        mode: always
    deploy_keys:
      allow: true               # DeployKeys can bypass when true
      mode: always

 ```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

Custom agent used: Documentation Agent
Agent that is an expert in writing documentation related to the policies.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 21, 2025 10:11
…ry.threats.md

Co-authored-by: david3107 <20040740+david3107@users.noreply.github.com>
Co-authored-by: david3107 <20040740+david3107@users.noreply.github.com>
Co-authored-by: david3107 <20040740+david3107@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tag settings to repository readme Add tag protection policy documentation to repository.readme.md Nov 21, 2025
Copilot AI requested a review from david3107 November 21, 2025 10:14
@david3107 david3107 marked this pull request as ready for review December 23, 2025 09:47
@david3107 david3107 requested a review from theztefan as a code owner December 23, 2025 09:47

@david3107 david3107 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works

@david3107 david3107 merged commit ab18cbb into main Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Tag settings to repository.readme.md

2 participants