Skip to content

Add protected-label authorization for /label and /remove-label#543

Draft
timja with Copilot wants to merge 2 commits into
mainfrom
copilot/feature-protected-labels
Draft

Add protected-label authorization for /label and /remove-label#543
timja with Copilot wants to merge 2 commits into
mainfrom
copilot/feature-protected-labels

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This adds per-label authorization so sensitive labels cannot be added/removed by low-permission actors. Repositories can now mark labels as protected and restrict their modification to trusted repository roles.

  • Config surface

    • Added protectedLabels to:
      • commands.label
      • commands.removeLabel
    • Default config now includes empty protectedLabels arrays.
  • Authorization behavior

    • Label operations now gate protected labels by GitHub author_association.
    • Protected labels are only modifiable by COLLABORATOR, MEMBER, or OWNER.
    • Existing allowedLabels behavior remains intact and is evaluated alongside protected-label checks.
  • Command wiring

    • Added author-association extraction from issue comments, PR bodies, and PR reviews.
    • Passed association context into labelEnabled / removeLabelEnabled checks from command handlers.
  • Docs and examples

    • README now documents protectedLabels and its semantics for both label commands.
commands:
  label:
    enabled: true
    allowedLabels: [] # optional allow-list
    protectedLabels: ["status:active-incident"] # restricted to COLLABORATOR/MEMBER/OWNER
  removeLabel:
    enabled: true
    allowedLabels: []
    protectedLabels: ["status:active-incident"]

Copilot AI linked an issue Jul 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add protected labels feature to restrict label permissions Add protected-label authorization for /label and /remove-label Jul 25, 2026
Copilot finished work on behalf of timja July 25, 2026 08:03
Copilot AI requested a review from timja July 25, 2026 08:03
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.

Feature Request: protected labels

2 participants