Skip to content

Commit c7e7e61

Browse files
denelonCopilot
andauthored
Add Copilot-Instructions label policy rule (#6440)
## 📖 Description Adds a policy-bot rule to automatically apply a `Copilot-Instructions` label to pull requests that modify `.github/copilot-instructions.md` or any `.github/instructions/*.instructions.md` file, so reviewers get extra visibility when Copilot's guidance changes. The rule triggers on PR Opened and Synchronize, matches files via regex, and is guarded with a ot: hasLabel check so it won't re-fire once the label is already applied. Created with GitHub Copilot's assistance. ## 🔗 References Closes #6439 ## 🔍 Validation - Validated the YAML with PowerShell's powershell-yaml module (ConvertFrom-Yaml). - Cross-checked all conditions/actions (payloadType, isAction, ilesMatchPattern, hasLabel, �ddLabel) against the documented GitOps.PullRequestIssueManagement policy schema. - Mirrors the existing idempotency pattern already used elsewhere in this file. ## ✅ Checklist - [x] Signed the [Contributor License Agreement](https://cla.opensource.microsoft.com) - [x] Linked to an issue - [ ] Updated [Release Notes](../doc/ReleaseNotes.md) (if applicable) - [ ] Updated documentation (if applicable) - [ ] Updated [Copilot instructions](.github/copilot-instructions.md) (if build, architecture, or conventions changed) ## 📋 Issue Type - [ ] Bug fix - [ ] Feature - [x] Task ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/6440) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 09f6afd commit c7e7e61

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/policies/labelManagement.issueOpened.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ configuration:
1515
action: Opened
1616
then:
1717
- addCodeFlowLink
18+
- description: Add Copilot-Instructions label to PRs modifying Copilot instruction files
19+
if:
20+
- payloadType: Pull_Request
21+
- or:
22+
- isAction:
23+
action: Opened
24+
- isAction:
25+
action: Synchronize
26+
- filesMatchPattern:
27+
pattern: ^\.github/(copilot-instructions\.md|instructions/.+\.instructions\.md)$
28+
matchAny: true
29+
- not:
30+
hasLabel:
31+
label: Copilot-Instructions
32+
then:
33+
- addLabel:
34+
label: Copilot-Instructions
1835
- description: Check for modifications of Localization files in new PRs
1936
if:
2037
- payloadType: Pull_Request

0 commit comments

Comments
 (0)