1717 NODE_VERSION : lts/*
1818
1919jobs :
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 }}"
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