mirror of
https://github.com/github/awesome-copilot.git
synced 2026-10-12 14:54:16 +00:00
* Add submission-gate check, merge-risk tiers, and PR status state machine (#4184) Phase 2 (enforcement) of github/awesome-copilot#4184: - submission-gate aggregate required check (reader) with infra vs contribution failure classification - merge-risk:low/medium/high classification from .github/risk-tiers.yml with tier approval policy - Submission Gate Writer maintaining state labels and a persistent status comment - /rerun-checks and /request-review PR commands - validate-skills and validate-submission-gate workflows, unit tests, and maintainer docs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fix codespell findings and add spelling to submission gate checks Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Harden submission gate per review feedback - Publish the submission-gate check from the trusted writer via the Checks API and flag any other submission-gate check run as tampering - Fail closed on truncated file lists, unscannable diffs, permission lookup errors, and skipped required checks - Discard evaluations when the PR head or reviews change mid-run - Low tier requires a resource owner approval - Commands must start the comment, matching the workflow filter Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Address #4190 review: command reader/writer, pools, paths, staleness - Split /rerun-checks and /request-review into a read-only issue_comment reader and a workflow_run writer that re-reads the comment, PR, and permission before writing. - Drop the workflow-security pool; agentic workflows and hooks are content (medium unless they add scripts or hook commands); the core pool is core-maintainers. - Include each check's workflow file and eng scripts in its paths. - Discard evaluations when the base branch or risk labels change; run the gate on PR edits (retargeting). - Correct copies of the writer's check that claim success while the evaluation fails. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fail closed on lost contributor signal; publish gate check before labels - A contributor check whose pr-check job succeeded but whose result artifact is missing or unreadable is now an infrastructure failure, so a lost HIGH signal can't lower the approval tier. - Publish the submission-gate check right after stale-state revalidation; label and comment sync are independent and reported afterwards. - Revert the self-path added to validate-agentic-workflows-pr.yml's trigger: that workflow rejects any .github change. Exempt it in the drift test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fail closed on bad routing config; advisory checks never hold the gate - loadGateConfig: a missing review-routing.yml still falls back, but a file that can't be parsed (or whose pools isn't a mapping) now throws instead of silently relaxing approvals. - Pending required: false checks no longer keep the PR in awaiting-automation or the gate check in progress, and the polling loop doesn't wait on them. They render as pending (advisory). - PR commands: 👀 marks a command as claimed; 🚀 is written only after the reply is posted and is the only replay guard, so a run that failed partway can be retried. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Fix codespell: unparseable -> unparsable Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
153 lines
5.5 KiB
YAML
153 lines
5.5 KiB
YAML
# Merge risk tiers.
|
|
#
|
|
# Automation (eng/submission-gate.mjs) applies exactly one of `merge-risk:low`,
|
|
# `merge-risk:medium`, or `merge-risk:high` to every open PR and the
|
|
# `submission-gate` check enforces the approvals each tier requires.
|
|
# See docs/maintainers/submission-gate.md.
|
|
#
|
|
# Evaluation order:
|
|
# 1. high if any changed file matches `high.paths`, any added line matches a
|
|
# `high.capabilities` trigger, a `high.labels` label is present, or the
|
|
# changes can't be fully scanned (GitHub truncated the file list, or a
|
|
# text file in a capability's scope has no diff to scan).
|
|
# 2. low if every changed file matches `low.paths`, or the PR only modifies
|
|
# existing resource files (no added/removed/renamed files) and the total
|
|
# change is at most `low.small_update.max_changed_lines`.
|
|
# 3. medium otherwise.
|
|
#
|
|
# This file is a review-policy file: changing it places a PR in merge-risk:high.
|
|
|
|
high:
|
|
description: Privileged execution, automation, or review-policy change
|
|
paths:
|
|
# Review policy and automation
|
|
- ".github/**"
|
|
- "CODEOWNERS"
|
|
- "docs/CODEOWNERS"
|
|
# Build, release, and repository scripts
|
|
- "eng/**"
|
|
- "scripts/**"
|
|
- "package.json"
|
|
- "package-lock.json"
|
|
# MCP server configuration
|
|
- "**/mcp.json"
|
|
- "**/.mcp.json"
|
|
# Bundled executable scripts (hooks, skills, and plugins). Agentic workflow
|
|
# sources (`workflows/**`) and hook metadata (`hooks/**`) are content; a hook
|
|
# command in hooks.json is caught by the `mcp-server-command` capability.
|
|
- "**/*.sh"
|
|
- "**/*.bash"
|
|
- "**/*.ps1"
|
|
- "**/*.psm1"
|
|
- "**/*.bat"
|
|
- "**/*.cmd"
|
|
- "**/*.py"
|
|
- "skills/**/scripts/**"
|
|
- "plugins/**/scripts/**"
|
|
# Plugin marketplace sources for externally hosted code
|
|
- "plugins/external.json"
|
|
# Generated output that lives under a high-risk path but is safe to regenerate.
|
|
exclude_paths:
|
|
- ".github/plugin/marketplace.json"
|
|
# Regexes matched against added lines of the diff. `files` limits where each applies.
|
|
capabilities:
|
|
- id: process-execution
|
|
description: Spawns processes or evaluates code
|
|
files: ["extensions/**", "plugins/**", "skills/**", "website/**"]
|
|
pattern: "child_process|\\bexecSync\\(|\\bexecFile(Sync)?\\(|\\bspawn(Sync)?\\(|\\beval\\(|new Function\\(|node:vm|require\\(['\"]vm['\"]\\)"
|
|
- id: remote-script-execution
|
|
description: Pipes a downloaded script into a shell
|
|
pattern: "(curl|wget)[^\\n|]*\\|\\s*(sudo\\s+)?(ba|z)?sh\\b|(iwr|irm|Invoke-WebRequest|Invoke-RestMethod)[^\\n|]*\\|\\s*(iex|Invoke-Expression)|Invoke-Expression"
|
|
- id: mcp-server-command
|
|
description: Declares an MCP server or hook command
|
|
files: ["plugins/**/*.json", "extensions/**/*.json", "skills/**/*.json", "hooks/**/*.json"]
|
|
pattern: "\"(mcpServers|command|bash|powershell)\"\\s*:"
|
|
# Files whose missing diff is acceptable: binaries GitHub never diffs, and generated
|
|
# documentation whose sources are scanned. Other files in a capability's scope without
|
|
# a diff (binary or too large) fail closed to high because their added lines can't be scanned.
|
|
unscanned_paths:
|
|
- "docs/**"
|
|
- "README.md"
|
|
- ".github/plugin/marketplace.json"
|
|
- "**/*.png"
|
|
- "**/*.jpg"
|
|
- "**/*.jpeg"
|
|
- "**/*.gif"
|
|
- "**/*.webp"
|
|
- "**/*.ico"
|
|
- "**/*.pdf"
|
|
- "**/*.woff"
|
|
- "**/*.woff2"
|
|
- "**/*.ttf"
|
|
- "**/*.otf"
|
|
- "**/*.mp4"
|
|
- "**/*.webm"
|
|
- "**/*.zip"
|
|
labels:
|
|
# Applied by the Contributor Reputation Check writer.
|
|
- "needs-review:HIGH"
|
|
approvals:
|
|
required: 2
|
|
require_core: true
|
|
|
|
medium:
|
|
description: New or substantially changed resource without privileged execution
|
|
approvals:
|
|
required: 1
|
|
require_domain: true
|
|
|
|
low:
|
|
description: Documentation, metadata, generated output, or a small update to an existing resource
|
|
paths:
|
|
- "docs/**"
|
|
- "README.md"
|
|
- "CONTRIBUTING.md"
|
|
- "CODE_OF_CONDUCT.md"
|
|
- "SECURITY.md"
|
|
- "SUPPORT.md"
|
|
- "LICENSE"
|
|
- ".all-contributorsrc"
|
|
- ".github/plugin/marketplace.json"
|
|
- "**/*.png"
|
|
- "**/*.jpg"
|
|
- "**/*.jpeg"
|
|
- "**/*.gif"
|
|
- "**/*.svg"
|
|
- "**/*.webp"
|
|
small_update:
|
|
max_changed_lines: 40
|
|
# Existing resources that may be updated in a small change and stay low risk.
|
|
resource_paths:
|
|
- "agents/**"
|
|
- "instructions/**"
|
|
- "skills/**"
|
|
- "plugins/**"
|
|
- "extensions/**"
|
|
approvals:
|
|
# One approval from an owner of the changed resource (its domain pool, or the core
|
|
# pools for files outside every domain). Until pools are staffed, any approver with
|
|
# write access counts.
|
|
required: 1
|
|
require_owner: true
|
|
|
|
# Areas used to pick the domain reviewer pool from .github/review-routing.yml.
|
|
# `pools` are routing pool keys. When a matching pool has no reviewers yet, any
|
|
# approver with write access satisfies the domain requirement.
|
|
domains:
|
|
canvas:
|
|
paths: ["extensions/**"]
|
|
pools: ["canvas"]
|
|
plugin:
|
|
paths: ["plugins/**"]
|
|
pools: ["plugin"]
|
|
content:
|
|
paths: ["agents/**", "instructions/**", "skills/**", "workflows/**", "hooks/**"]
|
|
pools: ["content"]
|
|
# Files outside every domain (repository automation such as `.github/workflows/**`,
|
|
# `eng/**`, review policy, and docs) are owned by the core pools.
|
|
|
|
# Routing pools whose members count as core maintainers for high-risk approvals.
|
|
# Until those pools are staffed, users with admin or maintain permission on the
|
|
# repository count instead.
|
|
core_pools: ["core-maintainers"]
|