File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,9 +200,7 @@ jobs:
200200
201201 // 4. Staleness Check (Scheduled only)
202202 if (pr.state === 'open' && context.eventName !== 'pull_request') {
203- // PRs with help wanted/maintainer only labels are still checked for staleness
204- // but usually given more leeway. Here we stick to 30 days of no maintainer activity.
205-
203+ // Skip PRs that were created less than 30 days ago - they cannot be stale yet
206204 const prCreatedAt = new Date(pr.created_at);
207205 if (prCreatedAt > thirtyDaysAgo) continue;
208206
@@ -229,7 +227,14 @@ jobs:
229227 } catch (e) {}
230228
231229 if (lastActivity < thirtyDaysAgo) {
232- core.info(`PR #${pr.number} is stale.`);
230+ const labels = pr.labels.map(l => l.name.toLowerCase());
231+ const isProtected = labels.includes('help wanted') || labels.includes('🔒 maintainer only');
232+ if (isProtected) {
233+ core.info(`PR #${pr.number} is stale but has a protected label. Skipping closure.`);
234+ continue;
235+ }
236+
237+ core.info(`PR #${pr.number} is stale (no maintainer activity for 30+ days). Closing.`);
233238 if (!dryRun) {
234239 await github.rest.issues.createComment({
235240 owner: context.repo.owner,
You can’t perform that action at this time.
0 commit comments