diff --git a/.github/workflows/pr-triage.yml b/.github/workflows/pr-triage.yml index 2b65853..8d5a933 100644 --- a/.github/workflows/pr-triage.yml +++ b/.github/workflows/pr-triage.yml @@ -1,7 +1,11 @@ name: PR Triage +# Runs on pull_request_target, not pull_request: fork PRs get a read-only +# GITHUB_TOKEN under pull_request regardless of the permissions below, so the +# label/comment writes 403. This job never checks out or runs PR head code (it +# only reads context.payload and the files API), so pull_request_target is safe. on: - pull_request: + pull_request_target: types: [opened, edited, synchronize, reopened] permissions: @@ -64,8 +68,8 @@ jobs: if (isFork && touchesWorkflows) want.add("workflow-change"); const changedRust = names.some(n => n.startsWith("crates/") && n.endsWith(".rs")); - // A test can live in a tests/ dir, a *_test.rs file, or — the common Rust - // pattern — an inline #[test] / #[cfg(test)] block added inside the source file. + // A test can live in a tests/ dir, a *_test.rs file, or (the common Rust + // pattern) an inline #[test] / #[cfg(test)] block added inside the source file. const addsInlineTest = files.some(f => f.filename.endsWith(".rs") && f.patch && /^\+.*#\[(test\]|cfg\(test\))/m.test(f.patch)); @@ -104,7 +108,7 @@ jobs: const reasons = { "needs-issue": "Link the issue this addresses (`Closes #123`). For protocol changes, open an issue first.", - "needs-description": "Add a short summary of what changes and why — the template's Summary and Motivation sections.", + "needs-description": "Add a short summary of what changes and why: the template's Summary and Motivation sections.", "needs-tests": "This changes Rust source but no tests changed. Tests are required for fixes and strongly encouraged for features.", }; const lines = advisory.map(l => `- ${reasons[l]}`).join("\n"); diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0ecebc7..2d2b21c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -23,17 +23,18 @@ jobs: # Act on PRs only; never on issues. days-before-issue-stale: -1 days-before-issue-close: -1 - # Only PRs the triage step flagged as needing an author response. - only-pr-labels: "needs-issue,needs-description" + # Only PRs the triage step flagged as missing a real description. + # needs-issue is advisory-only (linking an issue is a SHOULD, and many + # legitimate small PRs have none) so it does not drive auto-close. + only-pr-labels: "needs-description" stale-pr-label: "stale" exempt-pr-labels: "workflow-change,security,pinned" remove-stale-when-updated: true stale-pr-message: > - This PR has been inactive for 14 days and is still missing a linked issue - or a description. It will be closed in 7 days if there's no update. Push a - change or leave a comment to keep it open — no hard feelings, you can reopen - anytime. + This PR has been inactive for 14 days and is still missing a description. + It will be closed in 7 days if there's no update. Push a change or leave a + comment to keep it open. No hard feelings, you can reopen anytime. close-pr-message: > - Closing due to inactivity. Reopen whenever you're ready to update it — see + Closing due to inactivity. Reopen whenever you're ready to update it. See CONTRIBUTING.md for what helps us review quickly. ascending: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d4ff77d..fd939c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,9 +69,10 @@ expected to clear a basic quality bar: - **A real description.** Say what changes and why. "Update code" is not a description. A triage bot labels PRs that are missing these and leaves a short note. Nothing is closed -automatically while you're engaging. A flagged PR that goes 14 days with no linked issue or -description gets a stale warning, and is closed 7 days later if still untouched. Closed PRs can -be reopened at any time once updated. +automatically while you're engaging. A flagged PR still missing a description after 14 days of +inactivity gets a stale warning, and is closed 7 days later if still untouched. A missing issue +link alone never triggers closure; that label stays advisory. Closed PRs can be reopened at any +time once updated. ## Development environment