Skip to content

Commit 20159b7

Browse files
committed
1 parent 03fb789 commit 20159b7

File tree

1 file changed

+55
-41
lines changed

1 file changed

+55
-41
lines changed

.github/workflows/commit-queue.yml

Lines changed: 55 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ on:
1010
# `pull_request` event is triggered on a PR from a fork, GITHUB_TOKEN will
1111
# be read-only, and the Action won't have access to any other repository
1212
# secrets, which it needs to access Jenkins API.
13-
schedule:
14-
- cron: '*/5 * * * *'
13+
# schedule:
14+
# - cron: '*/5 * * * *'
15+
workflow_dispatch:
16+
1517

1618
concurrency: ${{ github.workflow }}
1719

@@ -25,63 +27,75 @@ jobs:
2527
get_mergeable_prs:
2628
permissions:
2729
pull-requests: read
28-
if: github.repository == 'nodejs/node'
30+
# if: github.repository == 'nodejs/node'
2931
runs-on: ubuntu-latest
3032
outputs:
3133
numbers: ${{ steps.get_mergeable_prs.outputs.numbers }}
3234
steps:
3335
- name: Get Pull Requests
3436
id: get_mergeable_prs
35-
run: >
36-
gh pr list \
37+
run: |
38+
prs=$(gh pr list \
39+
--repo ${{ github.repository }} \
40+
--base ${{ github.ref_name }} \
41+
--label 'commit-queue' \
42+
--json 'number' \
43+
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")" \
44+
-t '{{ range . }}{{ .number }} {{ end }}' \
45+
--limit 100)
46+
fast_track_prs=$(gh pr list \
3747
--repo ${{ github.repository }} \
3848
--base ${{ github.ref_name }} \
3949
--label 'commit-queue' \
50+
--label 'fast-track' \
4051
--json 'number' \
41-
-t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
42-
--limit 100
52+
-t '{{ range . }}{{ .number }} {{ end }}' \
53+
--limit 100)
54+
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
55+
echo "numbers=$numbers" >> $GITHUB_OUTPUT
4356
env:
4457
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4558
commitQueue:
4659
needs: get_mergeable_prs
4760
if: needs.get_mergeable_prs.outputs.numbers != ''
4861
runs-on: ubuntu-latest
4962
steps:
50-
- uses: actions/checkout@v3
51-
with:
52-
# Needs the whole git history for ncu to work
53-
# See https://github.com/nodejs/node-core-utils/pull/486
54-
fetch-depth: 0
55-
# A personal token is required because pushing with GITHUB_TOKEN will
56-
# prevent commits from running CI after they land. It needs
57-
# to be set here because `checkout` configures GitHub authentication
58-
# for push as well.
59-
token: ${{ secrets.GH_USER_TOKEN }}
63+
- run: echo ${{ needs.get_mergeable_prs.outputs.numbers }}
64+
# - uses: actions/checkout@v3
65+
# with:
66+
# # Needs the whole git history for ncu to work
67+
# # See https://github.com/nodejs/node-core-utils/pull/486
68+
# fetch-depth: 0
69+
# # A personal token is required because pushing with GITHUB_TOKEN will
70+
# # prevent commits from running CI after they land. It needs
71+
# # to be set here because `checkout` configures GitHub authentication
72+
# # for push as well.
73+
# token: ${{ secrets.GH_USER_TOKEN }}
6074

61-
# Install dependencies
62-
- name: Install Node.js
63-
uses: actions/setup-node@v3
64-
with:
65-
node-version: ${{ env.NODE_VERSION }}
66-
- name: Install node-core-utils
67-
run: npm install -g node-core-utils@latest
75+
# # Install dependencies
76+
# - name: Install Node.js
77+
# uses: actions/setup-node@v3
78+
# with:
79+
# node-version: ${{ env.NODE_VERSION }}
80+
# - name: Install node-core-utils
81+
# run: npm install -g node-core-utils@latest
6882

69-
- name: Set variables
70-
run: |
71-
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
72-
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
83+
# - name: Set variables
84+
# run: |
85+
# echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
86+
# echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
7387

74-
- name: Configure node-core-utils
75-
run: |
76-
ncu-config set branch ${GITHUB_REF_NAME}
77-
ncu-config set upstream origin
78-
ncu-config set username "${{ secrets.GH_USER_NAME }}"
79-
ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
80-
ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}"
81-
ncu-config set repo "${REPOSITORY}"
82-
ncu-config set owner "${OWNER}"
88+
# - name: Configure node-core-utils
89+
# run: |
90+
# ncu-config set branch ${GITHUB_REF_NAME}
91+
# ncu-config set upstream origin
92+
# ncu-config set username "${{ secrets.GH_USER_NAME }}"
93+
# ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
94+
# ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}"
95+
# ncu-config set repo "${REPOSITORY}"
96+
# ncu-config set owner "${OWNER}"
8397

84-
- name: Start the Commit Queue
85-
run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
86-
env:
87-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
98+
# - name: Start the Commit Queue
99+
# run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
100+
# env:
101+
# GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}

0 commit comments

Comments
 (0)