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
4
- # JENKINS_TOKEN: Jenkins token, to be used to check CI status
5
3
6
4
name : Create Release Proposal
7
5
11
9
release-line :
12
10
required : true
13
11
type : number
14
- default : 23
15
12
description : ' The release line (without dots or prefix). e.g: 22'
16
13
release-date :
17
14
required : true
18
15
type : string
19
- default : YYYY-MM-DD
20
16
description : The release date in YYYY-MM-DD format
21
17
22
18
concurrency : ${{ github.workflow }}
26
22
27
23
permissions :
28
24
contents : write
25
+ pull-requests : write
29
26
30
27
jobs :
31
28
releasePrepare :
@@ -36,16 +33,14 @@ jobs:
36
33
RELEASE_LINE : ${{ inputs.release-line }}
37
34
runs-on : ubuntu-latest
38
35
steps :
39
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40
37
with :
41
38
ref : ${{ env.STAGING_BRANCH }}
42
- # Needs the whole git history for ncu to work
43
- # See https://github.com/nodejs/node-core-utils/pull/486
44
- fetch-depth : 0
39
+ persist-credentials : false
45
40
46
41
# Install dependencies
47
42
- name : Install Node.js
48
- uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
43
+ uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
49
44
with :
50
45
node-version : ${{ env.NODE_VERSION }}
51
46
@@ -56,31 +51,32 @@ jobs:
56
51
run : |
57
52
ncu-config set branch "${RELEASE_BRANCH}"
58
53
ncu-config set upstream origin
59
- ncu-config set username "$USERNAME "
54
+ ncu-config set username "$GITHUB_ACTOR "
60
55
ncu-config set token "$GH_TOKEN"
61
- ncu-config set jenkins_token "$JENKINS_TOKEN"
62
56
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
63
57
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
64
58
env :
65
- USERNAME : ${{ secrets.JENKINS_USER }}
66
- GH_TOKEN : ${{ secrets.GH_USER_TOKEN }}
67
- JENKINS_TOKEN : ${{ secrets.JENKINS_TOKEN }}
59
+ GH_TOKEN : ${{ github.token }}
68
60
69
61
- name : Set up ghauth config (Ubuntu)
70
62
run : |
71
- mkdir -p ~/.config/changelog-maker/
72
- echo '{
73
- "user": "'$(ncu-config get username)'",
74
- "token": "'$(ncu-config get token)'"
75
- }' > ~/.config/changelog-maker/config.json
63
+ mkdir -p "${XDG_CONFIG_HOME:-~/.config}/changelog-maker"
64
+ echo '{}' | jq '{user: env.GITHUB_ACTOR, token: env.TOKEN}' > "${XDG_CONFIG_HOME:-~/.config}/changelog-maker/config.json"
65
+ env :
66
+ TOKEN : ${{ github.token }}
76
67
77
68
- name : Setup git author
78
69
run : |
79
70
git config --local user.email "[email protected] "
80
71
git config --local user.name "Node.js GitHub Bot"
81
72
82
73
- name : Start git node release prepare
74
+ # The curl command is to make sure we run the version of the script corresponding to the current workflow.
83
75
run : |
84
- ./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}"
76
+ git update-index --assume-unchanged tools/actions/create-release.sh
77
+ curl -fsSLo tools/actions/create-release.sh https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/create-release.sh
78
+ ./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}" "${GITHUB_ACTOR}"
85
79
env :
86
- GH_TOKEN : ${{ secrets.GH_USER_TOKEN }}
80
+ GH_TOKEN : ${{ github.token }}
81
+ # We want the bot to push the push the release commit so CI runs on it.
82
+ BOT_TOKEN : ${{ secrets.GH_USER_TOKEN }}
0 commit comments