lock-prs: Use the locked field

This commit is contained in:
bbhtt
2024-11-02 10:02:44 +05:30
parent 27d515572e
commit cbd6812c9c
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
cmd=$(gh pr list --repo "$REPO" -L 100000 --state closed --json number,updatedAt|jq '[.[] | select(.updatedAt >= (now - (7 * 24 * 60 * 60) | todate))] | sort_by(.updatedAt) | .[] | {number: .number, updatedAt: .updatedAt}'| jq '.number'|head -n 100)
for num in $cmd; do
if [ "$(gh api repos/$REPO/issues/$num --jq '.active_lock_reason'| wc -c)" -le 1 ]; then
if [ "$(gh api repos/$REPO/issues/$num --jq '.locked')" = "false" ]; then
if ! gh pr view --repo "$REPO" --json labels -q '.labels[].name' $num|grep -qE "^Stale$"; then
echo "Locking pull request $num"
gh pr lock --repo "$REPO" --reason "resolved" "$num"