Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/label-agent-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: label-agent-prs

on:
pull_request:
types:
- opened
- reopened
Comment on lines +3 to +7

permissions:
contents: read
pull-requests: write
issues: write

jobs:
label-agent-prs:
if: github.event.pull_request.user.type == 'Bot' || contains(github.event.pull_request.user.login, 'copilot')
runs-on: ubuntu-latest
steps:
- name: Ensure robot label exists
uses: actions/github-script@v7
with:
script: |
const labelName = 'robot';
const labelColor = '5319E7';
const labelDescription = 'Pull request created by a bot or automated agent';

try {
await github.rest.issues.getLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
});
} catch (error) {
if (error.status === 404) {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
color: labelColor,
description: labelDescription,
});
} else {
throw error;
}
}
Comment on lines +27 to +45

- name: Add robot label to PR
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['robot'],
});
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AGENTS.md

## Repository guidance for automated agents

- Keep changes minimal and focused on the task.
- Preserve existing content structure and frontmatter field names in `content/**/*.md`.
- Do not rename or remove required frontmatter keys.
- For ownership or reviewer changes, update `CODEOWNERS` only when explicitly requested by repo policy.
- Do not change workflows, labels, permissions, branch protection, or automation behavior unless explicitly requested.
- If a change affects repository policy or automation, ask before applying it.
- Prefer existing project patterns and avoid unrelated refactors.
- Before claiming a change is ready, run the repo checks that already exist: `npm test -- --runInBand` and `npm run lint`.
- If you open or update a PR, use a clear description and avoid introducing unrelated files.
Loading