diff --git a/.github/workflows/lock-prs.yml b/.github/workflows/lock-prs.yml index 0ccb6c9..8c4bdde 100644 --- a/.github/workflows/lock-prs.yml +++ b/.github/workflows/lock-prs.yml @@ -17,7 +17,9 @@ jobs: cmd=$(gh pr list --repo "$REPO" -L 100 --state closed --json number,updatedAt|jq '[.[] | select(.updatedAt >= (now - (7 * 24 * 60 * 60) | todate))] | sort_by(.updatedAt) | .[] | {number: .number, updatedAt: .updatedAt}'| jq '.number') for num in $cmd; do - gh pr lock --repo "$REPO" --reason "resolved" "$num" + if [ "$(gh api repos/$REPO/issues/$num --jq '.active_lock_reason'| wc -c)" -le 1 ]; then + gh pr lock --repo "$REPO" --reason "resolved" "$num" + fi done env: GITHUB_TOKEN: ${{ secrets.FLATHUBBOT_TOKEN }}