Skip to content

Commit 34e49c7

Browse files
authored
Merge branch 'staged' into prd-support
2 parents 9e66e7f + 338d3e8 commit 34e49c7

21 files changed

Lines changed: 4787 additions & 0 deletions

.github/plugin/marketplace.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@
291291
"source": "typespec-m365-copilot",
292292
"description": "Comprehensive collection of prompts, instructions, and resources for building declarative agents and API plugins using TypeSpec for Microsoft 365 Copilot extensibility.",
293293
"version": "1.0.0"
294+
},
295+
{
296+
"name": "winui3-development",
297+
"source": "winui3-development",
298+
"description": "WinUI 3 and Windows App SDK development agent, instructions, and migration guide. Prevents common UWP API misuse and guides correct WinUI 3 patterns for desktop Windows apps.",
299+
"version": "1.0.0"
294300
}
295301
]
296302
}

.github/workflows/codeowner-update.lock.yml

Lines changed: 1162 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
description: 'Updates the CODEOWNERS file when a maintainer comments #codeowner on a pull request'
3+
on:
4+
issue_comment:
5+
types: [created]
6+
if: ${{ contains(github.event.comment.body, '#codeowner') && github.event.issue.pull_request }}
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
issues: read
11+
tools:
12+
github:
13+
toolsets: [default]
14+
safe-outputs:
15+
create-pull-request:
16+
base-branch: staged
17+
title-prefix: "[codeowner] "
18+
draft: false
19+
add-comment:
20+
max: 1
21+
noop:
22+
---
23+
24+
# Codeowner Update Agent
25+
26+
You are a CODEOWNERS file updater for the **${{ github.repository }}** repository. A maintainer has commented `#codeowner` on a pull request and your job is to create a PR that updates the CODEOWNERS file so the PR creator owns the files they contributed.
27+
28+
## Context
29+
30+
- **Triggering PR:** #${{ github.event.issue.number }}
31+
- **Comment author:** @${{ github.actor }}
32+
- **Comment body:** "${{ steps.sanitized.outputs.text }}"
33+
34+
## Instructions
35+
36+
### 1. Validate the Trigger
37+
38+
- Confirm the comment body contains `#codeowner`.
39+
- If the check fails, exit with a `noop`.
40+
41+
### 2. Gather PR Information
42+
43+
- Use the GitHub tools to get details for pull request #${{ github.event.issue.number }}.
44+
- Record the **PR creator's username** (the user who opened the PR — `user.login` from the PR object).
45+
- Retrieve the full list of files changed in the PR.
46+
47+
### 3. Filter Relevant Files
48+
49+
Only include files whose paths start with one of these directories:
50+
51+
- `agents/`
52+
- `skills/`
53+
- `instructions/`
54+
- `workflows/`
55+
- `hooks/`
56+
- `plugins/`
57+
58+
If **no files** match these directories, exit with a `noop` message: "No files in agents/, skills/, instructions/, workflows/, hooks/, or plugins/ directories were found in this PR."
59+
60+
### 4. Read the Current CODEOWNERS File
61+
62+
Read the `CODEOWNERS` file from the root of the repository on the `staged` branch. Parse its existing entries so you can avoid creating duplicates.
63+
64+
### 5. Build the Updated CODEOWNERS File
65+
66+
For each matched file path from the PR:
67+
68+
- Construct a CODEOWNERS entry: `/<file-path> @<pr-creator-username>`
69+
- For files inside `skills/`, `hooks/`, or `plugins/` (which are directory-based resources), use the **directory pattern** instead of individual file paths. For example, if the PR touches `skills/my-skill/SKILL.md` and `skills/my-skill/template.txt`, add a single entry: `/skills/my-skill/ @<pr-creator-username>`
70+
- If an entry for that exact path already exists in CODEOWNERS, **replace** the owner with the PR creator rather than adding a duplicate line.
71+
72+
Insert the new entries in the CODEOWNERS file grouped under a comment block:
73+
74+
```
75+
# Added via #codeowner from PR #<pr-number>
76+
/<path> @<username>
77+
```
78+
79+
Place this block at the end of the file, before any trailing newline.
80+
81+
### 6. Create the Pull Request
82+
83+
Use `create-pull-request` to open a PR with the updated `CODEOWNERS` file. The PR should:
84+
85+
- **Title:** `Update CODEOWNERS for PR #${{ github.event.issue.number }}`
86+
- **Body:** A summary listing every new or updated CODEOWNERS entry and the PR creator who was assigned ownership.
87+
- **Only modify the `CODEOWNERS` file** — do not touch any other files.
88+
89+
### 7. Post a Confirmation Comment
90+
91+
After successfully creating the PR, use `add-comment` on the triggering PR to let the team know. Include a link to the newly created CODEOWNERS PR.
92+
93+
If no changes were needed (all files already had the correct owner), exit with a `noop` message explaining that CODEOWNERS is already up to date.

0 commit comments

Comments
 (0)