2121 if : github.repository == 'nodejs/node'
2222 runs-on : ubuntu-latest
2323 steps :
24+ - name : Get Pull Requests
25+ continue_on_error : true
26+ id : get_mergable_pull_requests
27+ run : gh pr list \
28+ --repo ${{ github.repository }} \
29+ --base ${{ env.DEFAULT_BRANCH }} \
30+ --label 'commit-queue' \
31+ --json 'number' \
32+ -t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
33+ --limit 100
2434 - uses : actions/checkout@v2
35+ if : ${{ success() }}
2536 with :
2637 # Needs the whole git history for ncu to work
2738 # See https://github.com/nodejs/node-core-utils/pull/486
@@ -34,19 +45,22 @@ jobs:
3445
3546 # Install dependencies
3647 - name : Install Node.js
48+ if : ${{ success() }}
3749 uses : actions/setup-node@v2
3850 with :
3951 node-version : ${{ env.NODE_VERSION }}
4052 - name : Install node-core-utils
4153 run : npm install -g node-core-utils@latest
4254
4355 - name : Set variables
56+ if : ${{ success() }}
4457 run : |
4558 echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
4659 echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
4760 echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
4861
4962 - name : Configure node-core-utils
63+ if : ${{ success() }}
5064 run : |
5165 ncu-config set branch ${DEFAULT_BRANCH}
5266 ncu-config set upstream origin
5771 ncu-config set owner "${OWNER}"
5872
5973 - 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"
74+ if : ${{ success() }}
75+ run : ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} "${{ steps.get_mergable_pull_requests.outputs.numbers }}"
6776 env :
6877 GITHUB_TOKEN : ${{ secrets.GH_USER_TOKEN }}
0 commit comments