Azure / Azure/azure-rest-api-specs

Restrict which users can add certain labels to PRs

Open
#30,599 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

It has been suggested to restrict which users can add certain labels to PRs. For example, some breaking change labels should only be applied by the breaking change board.

Implementation options:
- GitHub Action that triggers on pull_request:labeled event, checks user, and removes label if user is not allowed. Simpler, but could be circumvented, say if the action fails to run once when the label was added.
- GitHub Action that uses timeline events API (https://octokit.github.io/rest.js/v18/#issues-list-events-for-timeline) to block PRs, if the most recent timeline event for a label was added by a disallowed user. Slightly more complex to implement, but more reliable since it would block until it confirms the label was added by the correct user.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the proposed GitHub Action on the pull_request:labeled event with the timeline events API entry point linked in the issue. Define how unauthorized labels are detected, removed or blocked, and how failures are handled; the work is done when the chosen approach reliably prevents disallowed users from applying protected labels.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, github-actions
Domain
authorization, ci-cd
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.