◐ Shell
clean mode source ↗

tools: improve release proposal PR opening · nodejs/node@5620b2b

Original file line numberDiff line numberDiff line change

@@ -78,7 +78,7 @@ jobs:

7878

run: |

7979

git update-index --assume-unchanged tools/actions/create-release.sh

8080

curl -fsSLo tools/actions/create-release.sh https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/create-release.sh

81-

./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}"

81+

./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}" "${GITHUB_ACTOR}"

8282

env:

8383

GH_TOKEN: ${{ github.token }}

8484

# We want the bot to push the push the release commit so CI runs on it.

Original file line numberDiff line numberDiff line change

@@ -7,6 +7,7 @@ BOT_TOKEN=${BOT_TOKEN:-}

77
88

RELEASE_DATE=$1

99

RELEASE_LINE=$2

10+

RELEASER=$3

1011
1112

if [ -z "$RELEASE_DATE" ] || [ -z "$RELEASE_LINE" ]; then

1213

echo "Usage: $0 <RELEASE_DATE> <RELEASE_LINE>"

@@ -48,7 +49,7 @@ PR_URL="$(gh api \

4849

-H "Accept: application/vnd.github+json" \

4950

-H "X-GitHub-Api-Version: 2022-11-28" \

5051

"/repos/${GITHUB_REPOSITORY}/pulls" \

51-

-f "title=$TITLE" -f "body=$TEMP_BODY" -f "head=$HEAD_BRANCH" -f "base=v$RELEASE_LINE.x")"

52+

-f "title=$TITLE" -f "body=$TEMP_BODY" -f "head=$HEAD_BRANCH" -f "base=v$RELEASE_LINE.x" -f draft=true)"

5253
5354

# Push the release commit to the proposal branch using `BOT_TOKEN` from the env

5455

node --input-type=module - \

@@ -124,3 +125,5 @@ if (data.errors?.length) {

124125

}

125126

console.log(util.inspect(data, { depth: Infinity }));

126127

EOF

128+
129+

gh pr edit "$PR_URL" --add-label release --add-assignee "$RELEASER"