From 7b65c523f260bab782811f9cf9340d7929ec5974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 4 Dec 2024 11:55:11 +0100 Subject: [PATCH] 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. --- .github/workflows/create-release-proposal.yml | 3 ++- tools/actions/create-release.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release-proposal.yml b/.github/workflows/create-release-proposal.yml index d3ffa3ad49b5e2..a5a224c8ea801d 100644 --- a/.github/workflows/create-release-proposal.yml +++ b/.github/workflows/create-release-proposal.yml @@ -32,6 +32,7 @@ jobs: RELEASE_BRANCH: v${{ inputs.release-line }}.x RELEASE_DATE: ${{ inputs.release-date }} RELEASE_LINE: ${{ inputs.release-line }} + RELEASER: ${{ github.actor }} runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -78,7 +79,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}" "${RELEASER}" env: GH_TOKEN: ${{ github.token }} # We want the bot to push the push the release commit so CI runs on it. diff --git a/tools/actions/create-release.sh b/tools/actions/create-release.sh index e3cfd76952a18b..17878ff2e40d86 100755 --- a/tools/actions/create-release.sh +++ b/tools/actions/create-release.sh @@ -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 " @@ -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"