mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 18:29:08 +00:00
pr-check: Run on all recent PRs
This commit is contained in:
@@ -18,21 +18,13 @@ jobs:
|
||||
steps:
|
||||
- name: Fetch recent PR numbers
|
||||
run: |
|
||||
prs_raw=$(gh pr list --base "new-pr" -L 100 --state open --json number,createdAt,isDraft \
|
||||
prs_raw=$(gh pr list --base "new-pr" -L 50 --state open --json number,createdAt,isDraft \
|
||||
| jq -r '[.[]
|
||||
| select(.isDraft == false
|
||||
and .createdAt >= (now - (1 * 24 * 60 * 60) | todate))
|
||||
and .createdAt >= (now - (2 * 24 * 60 * 60) | todate))
|
||||
| .number]
|
||||
| .[]')
|
||||
|
||||
unreviewed_prs=()
|
||||
while IFS= read -r pr_num; do
|
||||
review_count=$(gh pr view "$pr_num" --json reviews -q '.reviews | length')
|
||||
if [ "$review_count" -eq 0 ]; then
|
||||
unreviewed_prs+=("$pr_num")
|
||||
fi
|
||||
done <<< "$prs_raw"
|
||||
prs_list=$(printf '%s\n' "${unreviewed_prs[@]}" | head -30 | paste -sd "," -)
|
||||
prs_list=$(printf '%s\n' $prs_raw | head -30 | paste -sd "," -)
|
||||
echo "PR_LIST=$prs_list" >> "$GITHUB_ENV"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user