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"