Skip to content

Commit f5a4c52

Browse files
MoLowdanielleadams
authored andcommitted
tools: do not run CQ on non-fast-tracked PRs open for less than 2 days
PR-URL: #45407 Fixes: #45405 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 0f45c90 commit f5a4c52

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/commit-queue.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,24 @@ jobs:
3232
steps:
3333
- name: Get Pull Requests
3434
id: get_mergeable_prs
35-
run: >
36-
numbers=$(gh pr list \
35+
run: |
36+
prs=$(gh pr list \
37+
--repo ${{ github.repository }} \
38+
--base ${{ github.ref_name }} \
39+
--label 'commit-queue' \
40+
--json 'number' \
41+
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")" \
42+
-t '{{ range . }}{{ .number }} {{ end }}' \
43+
--limit 100)
44+
fast_track_prs=$(gh pr list \
3745
--repo ${{ github.repository }} \
3846
--base ${{ github.ref_name }} \
3947
--label 'commit-queue' \
48+
--label 'fast-track' \
4049
--json 'number' \
4150
-t '{{ range . }}{{ .number }} {{ end }}' \
4251
--limit 100)
52+
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
4353
echo "numbers=$numbers" >> $GITHUB_OUTPUT
4454
env:
4555
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)