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
4- # JENKINS_TOKEN: Jenkins token, to be used to check CI status
53
64name : Create Release Proposal
75
119 release-line :
1210 required : true
1311 type : number
14- default : 23
1512 description : ' The release line (without dots or prefix). e.g: 22'
1613 release-date :
1714 required : true
1815 type : string
19- default : YYYY-MM-DD
2016 description : The release date in YYYY-MM-DD format
2117
2218concurrency : ${{ github.workflow }}
2622
2723permissions :
2824 contents : write
25+ pull-requests : write
2926
3027jobs :
3128 releasePrepare :
@@ -36,16 +33,14 @@ jobs:
3633 RELEASE_LINE : ${{ inputs.release-line }}
3734 runs-on : ubuntu-latest
3835 steps :
39- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4037 with :
4138 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
4540
4641 # Install dependencies
4742 - name : Install Node.js
48- uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
43+ uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
4944 with :
5045 node-version : ${{ env.NODE_VERSION }}
5146
@@ -56,31 +51,32 @@ jobs:
5651 run : |
5752 ncu-config set branch "${RELEASE_BRANCH}"
5853 ncu-config set upstream origin
59- ncu-config set username "$USERNAME "
54+ ncu-config set username "$GITHUB_ACTOR "
6055 ncu-config set token "$GH_TOKEN"
61- ncu-config set jenkins_token "$JENKINS_TOKEN"
6256 ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
6357 ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
6458 env :
65- USERNAME : ${{ secrets.JENKINS_USER }}
66- GH_TOKEN : ${{ secrets.GH_USER_TOKEN }}
67- JENKINS_TOKEN : ${{ secrets.JENKINS_TOKEN }}
59+ GH_TOKEN : ${{ github.token }}
6860
6961 - name : Set up ghauth config (Ubuntu)
7062 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 }}
7667
7768 - name : Setup git author
7869 run : |
7970 git config --local user.email "github-bot@iojs.org"
8071 git config --local user.name "Node.js GitHub Bot"
8172
8273 - 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.
8375 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}"
8579 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