ci: jq is available already
This commit is contained in:
parent
ef5769ecd3
commit
f745e4650f
1 changed files with 1 additions and 3 deletions
4
.github/workflows/lock-prs.yml
vendored
4
.github/workflows/lock-prs.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue