From cbd6812c9c2d71e142ebea5a13061a436466844f Mon Sep 17 00:00:00 2001 From: bbhtt Date: Sat, 2 Nov 2024 10:02:44 +0530 Subject: [PATCH] lock-prs: Use the locked field --- .github/workflows/lock-prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lock-prs.yml b/.github/workflows/lock-prs.yml index eb42a70..17cbe0c 100644 --- a/.github/workflows/lock-prs.yml +++ b/.github/workflows/lock-prs.yml @@ -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"