Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: improve release proposal PR opening #56161

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-release-proposal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion tools/actions/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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>"
Expand Down Expand Up @@ -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 - \
Expand Down Expand Up @@ -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"
Loading