tools: improve release proposal PR opening

- Open as draft. The releaser should review the PR and mark it as ready.
- Add the "release" label.
- Assign the releaser to the PR so it's clearer who's in charge and
  they can find it more easily. This will also notify and subscribe
  them to the PR.

PR-URL: https://github.com/nodejs/node/pull/56161
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Antoine du Hamel
2024-12-08 20:34:31 +01:00
committed by GitHub
parent 91b6e3c287
commit 4f51d461d1
2 changed files with 5 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ jobs:
run: |
git update-index --assume-unchanged tools/actions/create-release.sh
curl -fsSLo tools/actions/create-release.sh https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/create-release.sh
./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}"
./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}" "${GITHUB_ACTOR}"
env:
GH_TOKEN: ${{ github.token }}
# We want the bot to push the push the release commit so CI runs on it.

View File

@@ -7,6 +7,7 @@ BOT_TOKEN=${BOT_TOKEN:-}
RELEASE_DATE=$1
RELEASE_LINE=$2
RELEASER=$3
if [ -z "$RELEASE_DATE" ] || [ -z "$RELEASE_LINE" ]; then
echo "Usage: $0 <RELEASE_DATE> <RELEASE_LINE>"
@@ -48,7 +49,7 @@ PR_URL="$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${GITHUB_REPOSITORY}/pulls" \
-f "title=$TITLE" -f "body=$TEMP_BODY" -f "head=$HEAD_BRANCH" -f "base=v$RELEASE_LINE.x")"
-f "title=$TITLE" -f "body=$TEMP_BODY" -f "head=$HEAD_BRANCH" -f "base=v$RELEASE_LINE.x" -f draft=true)"
# Push the release commit to the proposal branch using `BOT_TOKEN` from the env
node --input-type=module - \
@@ -124,3 +125,5 @@ if (data.errors?.length) {
}
console.log(util.inspect(data, { depth: Infinity }));
EOF
gh pr edit "$PR_URL" --add-label release --add-assignee "$RELEASER"