mirror of
https://github.com/astral-sh/ruff.git
synced 2026-10-28 10:45:37 +08:00
Handle `bot:ai-policy-comment` and `bot:ai-policy-close` on issues and pull requests with the shared `ai-policy` action. The automation dispatcher runs `ai-policy.yml` on `main`, where an STS-issued `astral-automations-bot` token posts the policy reminder and optionally closes the target. Draft and fork PRs are supported. The workflow checks the current label and state without checking out PR code. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
54 lines
1.1 KiB
JSON
54 lines
1.1 KiB
JSON
{
|
|
"version": 2,
|
|
"repositories": {
|
|
"ruff": {
|
|
"name": "astral-sh/ruff",
|
|
"id": 523043277
|
|
}
|
|
},
|
|
"rules": [
|
|
{
|
|
"repository": "ruff",
|
|
"on": {
|
|
"pull_request": ["opened", "reopened", "ready_for_review"]
|
|
},
|
|
"workflow": "pull-request-reviewers.yml"
|
|
},
|
|
{
|
|
"repository": "ruff",
|
|
"on": {
|
|
"pull_request": ["labeled"]
|
|
},
|
|
"conditions": {
|
|
"/label/name": {
|
|
"one_of": ["bot:ai-policy-comment", "bot:ai-policy-close"]
|
|
}
|
|
},
|
|
"allow_draft": true,
|
|
"allow_forks": true,
|
|
"allow_stale_head": true,
|
|
"workflow": "ai-policy.yml",
|
|
"inputs": {
|
|
"label": "/label/name"
|
|
}
|
|
},
|
|
{
|
|
"repository": "ruff",
|
|
"on": {
|
|
"issues": ["labeled"]
|
|
},
|
|
"conditions": {
|
|
"/label/name": {
|
|
"one_of": ["bot:ai-policy-comment", "bot:ai-policy-close"]
|
|
},
|
|
"/issue/state": "open"
|
|
},
|
|
"workflow": "ai-policy.yml",
|
|
"inputs": {
|
|
"issue": "/issue/number",
|
|
"label": "/label/name"
|
|
}
|
|
}
|
|
]
|
|
}
|