ci: comment when stale-contributor.yml applies closing-soon#1290
Conversation
Previously, when a PR's pending-contributor label aged past STALE_DAYS (2), the workflow silently added closing-soon with no explanation to the author — unlike pr-discussion-check.yml, which always posts a [!CAUTION] comment explaining why the label was applied and what happens next. Discovered while investigating why PR #1272 had closing-soon despite already having a valid Discord Discussion URL - turned out to be this workflow (a separate, unrelated staleness check on pending-contributor), and the silence made it non-obvious which of the several closing-soon-related workflows was responsible. Add a matching caution comment (same [!CAUTION] alert style as pr-discussion-check.yml) when closing-soon is applied, stating how long the PR has been pending-contributor and that it auto-closes in 24 hours per close-stale-prs.yml. Uses a marker comment to avoid duplicate comments across runs (belt-and-suspenders alongside the existing early-continue guard for PRs that already have the label).
|
LGTM ✅ — Adds a clear caution comment to What This PR DoesWhen How It WorksAfter adding the Findings
Finding Details🟢 F1: Clean dedup patternUses the same 🟢 F2: Clear message contentThe caution block tells the author exactly what happened, when it happened ( 🟢 F3: Focused scopeOnly Baseline Check
What's Good (🟢)
Robustness Note (not blocking)If the |
Summary
Found while investigating why PR #1272 had the
closing-soonlabel despitealready having a valid Discord Discussion URL in its body. Turned out
pr-discussion-check.yml(the Discord URL check) wasn't the cause at all —it ran once, matched the URL, and cleared the label correctly. The label
kept reappearing because of a separate, unrelated workflow:
stale-contributor.yml, which addsclosing-soonto any PR that's held thepending-contributorlabel for more than 2 days — with no explanationposted to the author, unlike
pr-discussion-check.yml's Discord-URL check,which always posts a
[!CAUTION]comment.That silence is the actual problem this PR fixes: an author (or anyone
investigating) sees
closing-soonappear with zero context about which ofthe several
closing-soon-related workflows applied it or why, since there'sno comment to check.
Change
Add a caution comment to
stale-contributor.yml, matchingpr-discussion-check.yml's existing alert style, whenever it addsclosing-soon:Uses a
<!-- openab-stale-contributor-check -->marker (checked againstexisting comments) to avoid duplicate comments across runs — belt-and-suspenders
alongside the existing early-
continueguard for PRs that already carryclosing-soon.Scope
Only
stale-contributor.yml(PRs) was changed, per the specific ask.stale-issue.ymlhas the identical gap on the issue side but wasn't touchedhere — happy to open a follow-up for it if wanted.
Testing done
manipulating label-event timestamps in a test repo) — the added logic
mirrors
pr-discussion-check.yml's already-working comment-posting patternclosely enough that I'm confident in the mechanics, but flagging this as
the one part that's unverified against a live run.