ci: replace actions/stale with bot-aware mark-stale script#6477
Open
brtnfld wants to merge 2 commits into
Open
ci: replace actions/stale with bot-aware mark-stale script#6477brtnfld wants to merge 2 commits into
brtnfld wants to merge 2 commits into
Conversation
Contributor
Review ChecklistThis PR touches the following areas. Each needs a sign-off
|
actions/stale uses updatedAt to measure inactivity, so any bot event (e.g. the /remove-reviewer acknowledgment comment) resets the stale countdown even when there has been no meaningful human activity for months. PR HDFGroup#6332 was last touched by a human on 2026-04-02 but was not flagged because a reviewer-removal on 2026-06-11 refreshed the timestamp. Replace the actions/stale step with a custom mark-stale.js script (same pattern as alert-stale.js) that only counts non-bot comments, non-bot review submissions, and commits as meaningful activity. The script also removes the stale label if such activity occurs after the label was applied.
Two bugs with the keepalive checkbox on draft-stale PRs: 1. External contributors (fork authors) lack write access to edit the bot's comment, so clicking the checkbox silently fails for them. Fix: also treat a new non-bot comment posted after the keepalive comment as a sufficient keepalive signal. 2. The stale label could take up to 24 hours to be removed (daily cron only). Fix: add an issue_comment.created trigger so draft-pr-policy fires immediately when someone comments on a stale draft PR. mark-stale and alert-stale are guarded to only run on schedule/workflow_dispatch, not on every comment. Also fix lastRealActivityAt to exclude bot comments (matching mark-stale.js), so the keepalive and "Thanks for confirming" bot comments don't count as real activity when measuring staleness.
a6195ba to
31c4924
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
actions/staleusesupdatedAtto measure inactivity, so any bot event resets the stale countdown even with no meaningful human engagement. PR Add test for H5VLget_wrap_ctx API #6332 had its last human activity on 2026-04-02 but was never flagged because a/remove-reviewerbot comment on 2026-06-11 refreshedupdatedAt.actions/stalestep with a custommark-stale.jsscript (same pattern as the existingalert-stale.js) that only counts non-bot comments, non-bot review submissions, and commits as meaningful activity.actions/stale'sremove-stale-when-updatedbehavior — but bot-aware.