Skip to content

Commit c1f9791

Browse files
aduh95targos
authored andcommitted
tools: edit commit-queue workflow file
PR-URL: #58667 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent ff8a369 commit c1f9791

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

.github/workflows/commit-queue.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This action requires the following secrets to be set on the repository:
2-
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
32
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
3+
# JENKINS_USER: GitHub user whose Jenkins token is defined below
44
# JENKINS_TOKEN: Jenkins token, to be used to check CI status
55

66
name: Commit Queue
@@ -34,24 +34,24 @@ jobs:
3434
id: get_mergeable_prs
3535
run: |
3636
prs=$(gh pr list \
37-
--repo ${{ github.repository }} \
38-
--base ${{ github.ref_name }} \
37+
--repo "$GITHUB_REPOSITORY" \
38+
--base "$GITHUB_REF_NAME" \
3939
--label 'commit-queue' \
4040
--json 'number' \
4141
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
4242
-t '{{ range . }}{{ .number }} {{ end }}' \
4343
--limit 100)
4444
fast_track_prs=$(gh pr list \
45-
--repo ${{ github.repository }} \
46-
--base ${{ github.ref_name }} \
45+
--repo "$GITHUB_REPOSITORY" \
46+
--base "$GITHUB_REF_NAME" \
4747
--label 'commit-queue' \
4848
--label 'fast-track' \
4949
--search "-label:blocked" \
5050
--json 'number' \
5151
-t '{{ range . }}{{ .number }} {{ end }}' \
5252
--limit 100)
5353
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
54-
echo "numbers=$numbers" >> $GITHUB_OUTPUT
54+
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
5555
env:
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5757
commitQueue:
@@ -61,9 +61,6 @@ jobs:
6161
steps:
6262
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6363
with:
64-
# Needs the whole git history for ncu to work
65-
# See https://github.com/nodejs/node-core-utils/pull/486
66-
fetch-depth: 0
6764
# A personal token is required because pushing with GITHUB_TOKEN will
6865
# prevent commits from running CI after they land. It needs
6966
# to be set here because `checkout` configures GitHub authentication
@@ -80,24 +77,23 @@ jobs:
8077

8178
- name: Set variables
8279
run: |
83-
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
84-
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
80+
echo "REPOSITORY=$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)" >> "$GITHUB_ENV"
8581
8682
- name: Configure @node-core/utils
8783
run: |
88-
ncu-config set branch ${GITHUB_REF_NAME}
84+
ncu-config set branch "${GITHUB_REF_NAME}"
8985
ncu-config set upstream origin
9086
ncu-config set username "$USERNAME"
91-
ncu-config set token "$GH_TOKEN"
87+
ncu-config set token "$GITHUB_TOKEN"
9288
ncu-config set jenkins_token "$JENKINS_TOKEN"
9389
ncu-config set repo "${REPOSITORY}"
94-
ncu-config set owner "${OWNER}"
90+
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
9591
env:
9692
USERNAME: ${{ secrets.JENKINS_USER }}
97-
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
93+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
9894
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
9995

10096
- name: Start the Commit Queue
101-
run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
97+
run: ./tools/actions/commit-queue.sh "${GITHUB_REPOSITORY_OWNER}" "${REPOSITORY}" ${{ needs.get_mergeable_prs.outputs.numbers }}
10298
env:
10399
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}

0 commit comments

Comments
 (0)