17
17
NODE_VERSION : lts/*
18
18
19
19
jobs :
20
- commitQueue :
20
+ get_mergeable_prs :
21
21
if : github.repository == 'nodejs/node'
22
22
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
23
42
steps :
24
43
- uses : actions/checkout@v2
25
44
with :
@@ -44,11 +63,10 @@ jobs:
44
63
run : |
45
64
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
46
65
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
47
- echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
48
66
49
67
- name : Configure node-core-utils
50
68
run : |
51
- ncu-config set branch ${DEFAULT_BRANCH }
69
+ ncu-config set branch ${GITHUB_REF_NAME }
52
70
ncu-config set upstream origin
53
71
ncu-config set username "${{ secrets.GH_USER_NAME }}"
54
72
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
57
75
ncu-config set owner "${OWNER}"
58
76
59
77
- 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 }}"
67
79
env :
68
80
GITHUB_TOKEN : ${{ secrets.GH_USER_TOKEN }}
0 commit comments