Skip to content

Commit

Permalink
fix: solve the problem that the label may be cancelled by mistake
Browse files Browse the repository at this point in the history
feat: add some output information
  • Loading branch information
Lesords committed Jan 8, 2025
1 parent b46bebc commit d2033cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/stale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,30 @@ function main() {
dis_time=$(getTimeDiff $create_time)

if [ "$dis_time" -gt "$time_before_issue_stale" ]; then
echo "This issue needs to add stale label"
commentAndLabel
fi
continue
fi

last_comment_user=$(echo "$last_comment" | jq -r '.author.login')
last_comment_time=$(echo "$last_comment" | jq -r '.createdAt')
dis_time=$(getTimeDiff $last_comment_time)

if [ "$is_stale" ]; then
if [ "$dis_time" -gt "$time_before_issue_close" ]; then
echo "This issue needs to be closed"
commentAndClose
continue
fi

if [ "$last_comment_user" != "github-actions" ]; then
echo "This issue needs to be removed from the stale state"
unLabel
fi
else
if [ "$dis_time" -gt "$time_before_issue_stale" ]; then
echo "This issue needs to add stale label"
commentAndLabel
fi
fi
Expand Down

0 comments on commit d2033cf

Please sign in to comment.