Skip to content

Commit 6627c32

Browse files
authored
- fixes a bug where auto close issues would be too eager (#3453)
1 parent b415dd7 commit 6627c32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/close-no-recent.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ foreach($oldIssue in $oldIssues) {
1212
$lastLabelEventDate = [datetime]::Parse($lastLabelEvent.created_at)
1313
if ($lastCommentDate -gt $lastLabelEventDate) {
1414
gh issue edit $oldIssue.number --remove-label "$Env:NO_RECENT_ACTIVITY_LABEL" --remove-label "$Env:NEEDS_AUTHOR_FEEDBACK_LABEL" --add-label "$Env:NEEDS_ATTENTION_LABEL"
15-
} elseif (($lastCommentDate - $lastLabelEventDate) -le $inactivityDelay) {
15+
} elseif (($lastLabelEventDate - $lastCommentDate) -ge $inactivityDelay) {
1616
gh issue close $oldIssue.number -r "not planned"
1717
}
1818
}

scripts/label-no-recent.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ foreach($oldIssue in $oldIssues) {
1212
$lastLabelEventDate = [datetime]::Parse($lastLabelEvent.created_at)
1313
if ($lastCommentDate -gt $lastLabelEventDate) {
1414
gh issue edit $oldIssue.number --remove-label "$Env:NO_RECENT_ACTIVITY_LABEL" --remove-label "$Env:NEEDS_AUTHOR_FEEDBACK_LABEL" --add-label "$Env:NEEDS_ATTENTION_LABEL"
15-
} elseif (($lastCommentDate - $lastLabelEventDate) -le $inactivityDelay) {
15+
} elseif (($lastLabelEventDate -$lastCommentDate) -ge $inactivityDelay) {
1616
gh issue edit $oldIssue.number --add-label "$Env:NO_RECENT_ACTIVITY_LABEL" --remove-label "$Env:NEEDS_ATTENTION_LABEL"
1717
gh issue comment $oldIssue.number -b "$Env:NO_RECENT_ACTIVITY_COMMENT"
1818
}

0 commit comments

Comments
 (0)