1
1
# 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
3
2
# 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
4
4
# JENKINS_TOKEN: Jenkins token, to be used to check CI status
5
5
6
6
name : Commit Queue
@@ -34,24 +34,24 @@ jobs:
34
34
id : get_mergeable_prs
35
35
run : |
36
36
prs=$(gh pr list \
37
- --repo ${{ github.repository }} \
38
- --base ${{ github.ref_name }} \
37
+ --repo "$GITHUB_REPOSITORY" \
38
+ --base "$GITHUB_REF_NAME" \
39
39
--label 'commit-queue' \
40
40
--json 'number' \
41
41
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
42
42
-t '{{ range . }}{{ .number }} {{ end }}' \
43
43
--limit 100)
44
44
fast_track_prs=$(gh pr list \
45
- --repo ${{ github.repository }} \
46
- --base ${{ github.ref_name }} \
45
+ --repo "$GITHUB_REPOSITORY" \
46
+ --base "$GITHUB_REF_NAME" \
47
47
--label 'commit-queue' \
48
48
--label 'fast-track' \
49
49
--search "-label:blocked" \
50
50
--json 'number' \
51
51
-t '{{ range . }}{{ .number }} {{ end }}' \
52
52
--limit 100)
53
53
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
54
- echo "numbers=$numbers" >> $GITHUB_OUTPUT
54
+ echo "numbers=$numbers" >> " $GITHUB_OUTPUT"
55
55
env :
56
56
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57
57
commitQueue :
61
61
steps :
62
62
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63
63
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
67
64
# A personal token is required because pushing with GITHUB_TOKEN will
68
65
# prevent commits from running CI after they land. It needs
69
66
# to be set here because `checkout` configures GitHub authentication
@@ -80,24 +77,23 @@ jobs:
80
77
81
78
- name : Set variables
82
79
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"
85
81
86
82
- name : Configure @node-core/utils
87
83
run : |
88
- ncu-config set branch ${GITHUB_REF_NAME}
84
+ ncu-config set branch " ${GITHUB_REF_NAME}"
89
85
ncu-config set upstream origin
90
86
ncu-config set username "$USERNAME"
91
- ncu-config set token "$GH_TOKEN "
87
+ ncu-config set token "$GITHUB_TOKEN "
92
88
ncu-config set jenkins_token "$JENKINS_TOKEN"
93
89
ncu-config set repo "${REPOSITORY}"
94
- ncu-config set owner "${OWNER }"
90
+ ncu-config set owner "${GITHUB_REPOSITORY_OWNER }"
95
91
env :
96
92
USERNAME : ${{ secrets.JENKINS_USER }}
97
- GH_TOKEN : ${{ secrets.GH_USER_TOKEN }}
93
+ GITHUB_TOKEN : ${{ secrets.GH_USER_TOKEN }}
98
94
JENKINS_TOKEN : ${{ secrets.JENKINS_TOKEN }}
99
95
100
96
- 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 }}
102
98
env :
103
99
GITHUB_TOKEN : ${{ secrets.GH_USER_TOKEN }}
0 commit comments