ci: jq is available already

This commit is contained in:
bbhtt
2024-11-02 07:31:42 +05:30
parent ef5769ecd3
commit f745e4650f

View File

@@ -9,15 +9,13 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt install -y jq
- name: Lock closed PRs
run: |
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
if [ "$(gh api repos/$REPO/issues/$num --jq '.active_lock_reason'| wc -c)" -le 1 ]; then
echo "Locking pull request $num"
gh pr lock --repo "$REPO" --reason "resolved" "$num"
fi
done