Skip to content

Commit e15e57b

Browse files
authored
Fix MAX_OPEN_PRS gate failing with exit code 4 when no matching PRs exist (#346)
1 parent df35cf2 commit e15e57b

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

workflows/adhoc-qa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
run: |
1616
MAX_OPEN_PRS=8
1717
if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi
18-
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[adhoc-qa]"' --json number --jq 'length')
18+
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[adhoc-qa]"' --json number --jq 'length' 2>/dev/null || echo 0)
1919
[[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
2020
# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS
2121

workflows/efficiency-improver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
run: |
1919
MAX_OPEN_PRS=8
2020
if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi
21-
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[efficiency-improver]"' --json number --jq 'length')
21+
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[efficiency-improver]"' --json number --jq 'length' 2>/dev/null || echo 0)
2222
[[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
2323
# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS
2424

workflows/glossary-maintainer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
run: |
1212
MAX_OPEN_PRS=8
1313
if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi
14-
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[docs]"' --json number --jq 'length')
14+
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[docs]"' --json number --jq 'length' 2>/dev/null || echo 0)
1515
[[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
1616
# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS
1717

workflows/perf-improver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
run: |
2424
MAX_OPEN_PRS=8
2525
if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi
26-
COUNT=$(gh pr list --repo ${{ github.repository }} --state open --search 'in:title "[perf-improver]"' --json number --jq 'length')
26+
COUNT=$(gh pr list --repo ${{ github.repository }} --state open --search 'in:title "[perf-improver]"' --json number --jq 'length' 2>/dev/null || echo 0)
2727
[[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
2828
# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS
2929

workflows/test-improver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
run: |
2424
MAX_OPEN_PRS=8
2525
if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi
26-
COUNT=$(gh pr list --repo ${{ github.repository }} --state open --search 'in:title "[test-improver]"' --json number --jq 'length')
26+
COUNT=$(gh pr list --repo ${{ github.repository }} --state open --search 'in:title "[test-improver]"' --json number --jq 'length' 2>/dev/null || echo 0)
2727
[[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
2828
# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS
2929

0 commit comments

Comments
 (0)