FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/.github/workflows/commit-queue.yml at force-stringify-slow · codebytere/node · GitHub
codebytere
/
node
Public
forked from
nodejs/node
Notifications
You must be signed in to change notification settings
Fork
4
Star
6
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
.github
/
workflows
/
commit-queue.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
103 lines (93 loc) · 3.9 KB
Breadcrumbs
node
/
.github
/
workflows
/
commit-queue.yml
Copy path
File metadata and controls
103 lines (93 loc) · 3.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
This action requires the following secrets to be set on the repository:
#
GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
#
GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
#
JENKINS_TOKEN: Jenkins token, to be used to check CI status
name
:
Commit Queue
on
:
#
`schedule` event is used instead of `pull_request` because when a
#
`pull_request` event is triggered on a PR from a fork, GITHUB_TOKEN will
#
be read-only, and the Action won't have access to any other repository
#
secrets, which it needs to access Jenkins API.
schedule
:
-
cron
:
'
*/5 * * * *
'
concurrency
:
${{ github.workflow }}
env
:
NODE_VERSION
:
lts/*
permissions
:
contents
:
read
jobs
:
get_mergeable_prs
:
permissions
:
pull-requests
:
read
if
:
github.repository == 'nodejs/node'
runs-on
:
ubuntu-latest
outputs
:
numbers
:
${{ steps.get_mergeable_prs.outputs.numbers }}
steps
:
-
name
:
Get Pull Requests
id
:
get_mergeable_prs
run
:
|
prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--json 'number' \
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
fast_track_prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--label 'fast-track' \
--search "-label:blocked" \
--json 'number' \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
echo "numbers=$numbers" >> $GITHUB_OUTPUT
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
commitQueue
:
needs
:
get_mergeable_prs
if
:
needs.get_mergeable_prs.outputs.numbers != ''
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
#
v4.2.2
with
:
#
Needs the whole git history for ncu to work
#
See https://github.com/nodejs/node-core-utils/pull/486
fetch-depth
:
0
#
A personal token is required because pushing with GITHUB_TOKEN will
#
prevent commits from running CI after they land. It needs
#
to be set here because `checkout` configures GitHub authentication
#
for push as well.
token
:
${{ secrets.GH_USER_TOKEN }}
#
Install dependencies
-
name
:
Install Node.js
uses
:
actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
#
v4.4.0
with
:
node-version
:
${{ env.NODE_VERSION }}
-
name
:
Install @node-core/utils
run
:
npm install -g @node-core/utils
-
name
:
Set variables
run
:
|
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
-
name
:
Configure @node-core/utils
run
:
|
ncu-config set branch ${GITHUB_REF_NAME}
ncu-config set upstream origin
ncu-config set username "$USERNAME"
ncu-config set token "$GH_TOKEN"
ncu-config set jenkins_token "$JENKINS_TOKEN"
ncu-config set repo "${REPOSITORY}"
ncu-config set owner "${OWNER}"
env
:
USERNAME
:
${{ secrets.JENKINS_USER }}
GH_TOKEN
:
${{ secrets.GH_USER_TOKEN }}
JENKINS_TOKEN
:
${{ secrets.JENKINS_TOKEN }}
-
name
:
Start the Commit Queue
run
:
./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
env
:
GITHUB_TOKEN
:
${{ secrets.GH_USER_TOKEN }}
Back
|
FazBrowse Home
|
New Git URL