From ddca994fbd82ed200d74675da119a5c88efa55ae Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Sat, 12 Nov 2022 18:22:02 +0200 Subject: [PATCH] tools: do not run CQ on non-fast-tracked PRs open for less than 2 days MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/45407 Fixes: https://github.com/nodejs/node/issues/45405 Reviewed-By: Yagiz Nizipli Reviewed-By: Filip Skokan Reviewed-By: Antoine du Hamel Reviewed-By: Michaƫl Zasso --- .github/workflows/commit-queue.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml index 18a26666dee871..59ab3d2ce64263 100644 --- a/.github/workflows/commit-queue.yml +++ b/.github/workflows/commit-queue.yml @@ -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 }}