Skip to content

Commit

Permalink
tools: do not run CQ on non-fast-tracked PRs open for less than 2 days
Browse files Browse the repository at this point in the history
PR-URL: #45407
Fixes: #45405
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
MoLow authored Nov 12, 2022
1 parent 9baf748 commit 119559a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,24 @@ jobs:
steps:
- name: Get Pull Requests
id: get_mergeable_prs
run: >
numbers=$(gh pr list \
run: |
prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--json 'number' \
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")" \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
fast_track_prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--label 'fast-track' \
--json 'number' \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
echo "numbers=$numbers" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 119559a

Please sign in to comment.