mirror of
https://github.com/github/awesome-copilot.git
synced 2026-10-12 23:04:14 +00:00
chore: publish from main
This commit is contained in:
@@ -52,10 +52,16 @@ pools:
|
||||
team: github/awesome-copilot-content-reviewers
|
||||
reviewers: [] # TODO: add at least three reviewers for skills, agents, and instructions.
|
||||
backup: [] # TODO: add backup content reviewers.
|
||||
workshops:
|
||||
team: github/awesome-copilot-workshop-reviewers
|
||||
reviewers: [] # TODO: add at least three workshop reviewers.
|
||||
backup: [] # TODO: add backup workshop reviewers.
|
||||
|
||||
# Intent labels (applied by .github/workflows/label-pr-intent*.yml) mapped to
|
||||
# pools. Order is priority: the first route whose label is on the PR wins.
|
||||
routes:
|
||||
- label: workshops
|
||||
pool: workshops
|
||||
- label: canvas-extension
|
||||
pool: canvas
|
||||
- label: external-plugin
|
||||
|
||||
@@ -143,6 +143,12 @@ domains:
|
||||
content:
|
||||
paths: ["agents/**", "instructions/**", "skills/**", "workflows/**", "hooks/**"]
|
||||
pools: ["content"]
|
||||
workshops:
|
||||
paths:
|
||||
- "website/**/cli-for-beginners/**"
|
||||
- "website/**/app-for-beginners/**"
|
||||
- "website/**/copilot-workshops/**"
|
||||
pools: ["workshops"]
|
||||
# Files outside every domain (repository automation such as `.github/workflows/**`,
|
||||
# `eng/**`, review policy, and docs) are owned by the core pools.
|
||||
|
||||
|
||||
-1965
File diff suppressed because one or more lines are too long
@@ -1,94 +0,0 @@
|
||||
---
|
||||
description: "Updates the CODEOWNERS file when a maintainer comments #codeowner on a pull request"
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
if: ${{ contains(github.event.comment.body, '#codeowner') && github.event.issue.pull_request }}
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
issues: read
|
||||
copilot-requests: write
|
||||
tools:
|
||||
github:
|
||||
toolsets: [default]
|
||||
safe-outputs:
|
||||
create-pull-request:
|
||||
base-branch: main
|
||||
title-prefix: "[codeowner] "
|
||||
draft: false
|
||||
add-comment:
|
||||
max: 1
|
||||
noop:
|
||||
---
|
||||
|
||||
# Codeowner Update Agent
|
||||
|
||||
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.
|
||||
|
||||
## Context
|
||||
|
||||
- **Triggering PR:** #${{ github.event.issue.number }}
|
||||
- **Comment author:** @${{ github.actor }}
|
||||
- **Comment body:** "${{ steps.sanitized.outputs.text }}"
|
||||
|
||||
## Instructions
|
||||
|
||||
### 1. Validate the Trigger
|
||||
|
||||
- Confirm the comment body contains `#codeowner`.
|
||||
- If the check fails, exit with a `noop`.
|
||||
|
||||
### 2. Gather PR Information
|
||||
|
||||
- Use the GitHub tools to get details for pull request #${{ github.event.issue.number }}.
|
||||
- Record the **PR creator's username** (the user who opened the PR — `user.login` from the PR object).
|
||||
- Retrieve the full list of files changed in the PR.
|
||||
|
||||
### 3. Filter Relevant Files
|
||||
|
||||
Only include files whose paths start with one of these directories:
|
||||
|
||||
- `agents/`
|
||||
- `skills/`
|
||||
- `instructions/`
|
||||
- `workflows/`
|
||||
- `hooks/`
|
||||
- `plugins/`
|
||||
|
||||
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."
|
||||
|
||||
### 4. Read the Current CODEOWNERS File
|
||||
|
||||
Read the `CODEOWNERS` file from the root of the repository on the `main` branch. Parse its existing entries so you can avoid creating duplicates.
|
||||
|
||||
### 5. Build the Updated CODEOWNERS File
|
||||
|
||||
For each matched file path from the PR:
|
||||
|
||||
- Construct a CODEOWNERS entry: `/<file-path> @<pr-creator-username>`
|
||||
- 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>`
|
||||
- If an entry for that exact path already exists in CODEOWNERS, **replace** the owner with the PR creator rather than adding a duplicate line.
|
||||
|
||||
Insert the new entries in the CODEOWNERS file grouped under a comment block:
|
||||
|
||||
```
|
||||
# Added via #codeowner from PR #<pr-number>
|
||||
/<path> @<username>
|
||||
```
|
||||
|
||||
Place this block at the end of the file, before any trailing newline.
|
||||
|
||||
### 6. Create the Pull Request
|
||||
|
||||
Use `create-pull-request` to open a PR with the updated `CODEOWNERS` file. The PR should:
|
||||
|
||||
- **Title:** `Update CODEOWNERS for PR #${{ github.event.issue.number }}`
|
||||
- **Body:** A summary listing every new or updated CODEOWNERS entry and the PR creator who was assigned ownership.
|
||||
- **Only modify the `CODEOWNERS` file** — do not touch any other files.
|
||||
|
||||
### 7. Post a Confirmation Comment
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
@@ -46,6 +46,7 @@ jobs:
|
||||
'agent',
|
||||
'instructions',
|
||||
'new-submission',
|
||||
'workshops',
|
||||
'website-update',
|
||||
'external-plugin',
|
||||
'hooks',
|
||||
|
||||
@@ -27,6 +27,7 @@ jobs:
|
||||
'agent': true,
|
||||
'instructions': true,
|
||||
'new-submission': true,
|
||||
'workshops': true,
|
||||
'website-update': true,
|
||||
'external-plugin': true,
|
||||
'hooks': true,
|
||||
@@ -78,6 +79,9 @@ jobs:
|
||||
websiteUpdate: [
|
||||
/^website\//
|
||||
],
|
||||
workshops: [
|
||||
/^website\/(?:.*\/)?(?:cli-for-beginners|app-for-beginners|copilot-workshops)\//
|
||||
],
|
||||
externalPlugin: [
|
||||
/^plugins\/external\.json$/
|
||||
],
|
||||
@@ -130,6 +134,10 @@ jobs:
|
||||
desiredLabels.add('instructions');
|
||||
}
|
||||
|
||||
if (filenames.some((filename) => matchesAny(filename, patterns.workshops))) {
|
||||
desiredLabels.add('workshops');
|
||||
}
|
||||
|
||||
if (filenames.some((filename) => matchesAny(filename, patterns.websiteUpdate))) {
|
||||
desiredLabels.add('website-update');
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@ jobs:
|
||||
color: '006B75',
|
||||
description: 'PR adds at least one new contribution'
|
||||
},
|
||||
'workshops': {
|
||||
color: '7057FF',
|
||||
description: 'PR touches Copilot workshop content'
|
||||
},
|
||||
'website-update': {
|
||||
color: '0052CC',
|
||||
description: 'PR touches website content or code'
|
||||
|
||||
Reference in New Issue
Block a user