We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ea96e6 commit b54cf5dCopy full SHA for b54cf5d
1 file changed
tools/actions/commit-queue.sh
@@ -45,6 +45,17 @@ for pr in "$@"; do
45
continue
46
fi
47
48
+ # Skip PR if it has only one approval and was created less than 7 days ago
49
+ pr_meta=$(gh pr view "$pr" --json reviews,createdAt)
50
+ approvals=$(echo "$pr_meta" | jq '[.reviews[] | select(.state == "APPROVED")] | unique_by(.author.login) | length')
51
+ created_at=$(echo "$pr_meta" | jq -r '.createdAt')
52
+ created_epoch=$(date -d "$created_at" +%s)
53
+ seven_days_ago=$(date -d "7 days ago" +%s)
54
+ if [ "$approvals" -le 1 ] && [ "$created_epoch" -gt "$seven_days_ago" ]; then
55
+ echo "pr ${pr} skipped, only one approval and created less than 7 days ago"
56
+ continue
57
+ fi
58
+
59
# Delete the commit queue label
60
gh pr edit "$pr" --remove-label "$COMMIT_QUEUE_LABEL"
61
0 commit comments