Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c44185c

Browse filesBrowse files
aduh95targos
authored andcommitted
tools: fix GitHub Actions status when CQ is empty
Refs: #40985 (comment) PR-URL: #41193 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 74742c3 commit c44185c
Copy full SHA for c44185c

File tree

Expand file treeCollapse file tree

2 files changed

+42
-14
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+42
-14
lines changed
Open diff view settings
Collapse file

‎.github/workflows/auto-start-ci.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/auto-start-ci.yml
+20-4Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,27 @@ env:
1212
NODE_VERSION: lts/*
1313

1414
jobs:
15-
startCI:
15+
get_prs_for_ci:
1616
if: github.repository == 'nodejs/node'
1717
runs-on: ubuntu-latest
18+
outputs:
19+
numbers: ${{ steps.get_prs_for_ci.outputs.numbers }}
20+
steps:
21+
- name: Get Pull Requests
22+
id: get_prs_for_ci
23+
run: >
24+
gh pr list \
25+
--repo ${{ github.repository }} \
26+
--label 'request-ci' \
27+
--json 'number' \
28+
-t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
29+
--limit 100
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
startCI:
33+
needs: get_prs_for_ci
34+
if: needs.get_prs_for_ci.outputs.numbers != ''
35+
runs-on: ubuntu-latest
1836
steps:
1937
- uses: actions/checkout@v2
2038
with:
@@ -37,8 +55,6 @@ jobs:
3755
ncu-config set repo "$(echo ${{ github.repository }} | cut -d/ -f2)"
3856
3957
- name: Start the CI
40-
run: |
41-
PRs=$(gh pr list --label 'request-ci' --json number --jq 'map(.number) | .[]' --limit 100)
42-
./tools/actions/start-ci.sh "$PRs"
58+
run: ./tools/actions/start-ci.sh "${{ needs.get_prs_for_ci.outputs.numbers }}"
4359
env:
4460
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Collapse file

‎.github/workflows/commit-queue.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/commit-queue.yml
+22-10Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,28 @@ env:
1717
NODE_VERSION: lts/*
1818

1919
jobs:
20-
commitQueue:
20+
get_mergeable_prs:
2121
if: github.repository == 'nodejs/node'
2222
runs-on: ubuntu-latest
23+
outputs:
24+
numbers: ${{ steps.get_mergeable_prs.outputs.numbers }}
25+
steps:
26+
- name: Get Pull Requests
27+
id: get_mergeable_prs
28+
run: >
29+
gh pr list \
30+
--repo ${{ github.repository }} \
31+
--base ${{ github.ref_name }} \
32+
--label 'commit-queue' \
33+
--json 'number' \
34+
-t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
35+
--limit 100
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
commitQueue:
39+
needs: get_mergeable_prs
40+
if: needs.get_mergeable_prs.outputs.numbers != ''
41+
runs-on: ubuntu-latest
2342
steps:
2443
- uses: actions/checkout@v2
2544
with:
@@ -44,11 +63,10 @@ jobs:
4463
run: |
4564
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
4665
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
47-
echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
4866
4967
- name: Configure node-core-utils
5068
run: |
51-
ncu-config set branch ${DEFAULT_BRANCH}
69+
ncu-config set branch ${GITHUB_REF_NAME}
5270
ncu-config set upstream origin
5371
ncu-config set username "${{ secrets.GH_USER_NAME }}"
5472
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
@@ -57,12 +75,6 @@ jobs:
5775
ncu-config set owner "${OWNER}"
5876
5977
- name: Start the Commit Queue
60-
run: |
61-
PRs=$(gh pr list \
62-
--base ${{ env.DEFAULT_BRANCH }} \
63-
--label 'commit-queue' \
64-
--json number --jq 'map(.number) | .[]' \
65-
--limit 100)
66-
./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} "$PRs"
78+
run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} "${{ needs.get_mergeable_prs.outputs.numbers }}"
6779
env:
6880
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.