From 010491cd6cf4bffdd334ad891e19bececa4a4ca7 Mon Sep 17 00:00:00 2001 From: Sai Kumar Battinoju <88789928+saikumarrs@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:54:01 +0530 Subject: [PATCH] chore: automatically link post release pr to release ticket (#2009) * chore: automatically link post release pr to release ticket * chore: fix typo --- .github/workflows/draft-new-release.yml | 18 +++++++++++++----- .github/workflows/publish-new-release.yml | 21 +++++++++++++++++++-- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index c7c4fe135..d1e22e492 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -112,14 +112,22 @@ jobs: source_branch: ${{ steps.create-release.outputs.branch_name }} destination_branch: 'main' github_token: ${{ secrets.PAT }} - pr_title: 'chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main' + pr_title: 'chore(release): merge ${{ steps.create-release.outputs.branch_name }} into main [${{ github.event.inputs.release_ticket_id }}]' pr_body: | - :crown: *An automated PR* + :crown: **Automated Release PR** - This PR is created automatically by the GitHub Actions workflow to merge the release branch into the main branch. + This pull request was created automatically by the GitHub Actions workflow. It merges the release branch (`${{ steps.create-release.outputs.branch_name }}`) into the `main` branch. + + This ensures that the latest release branch changes are incorporated into the `main` branch for production. + + ### Details + - **Release Version**: v$NEW_VERSION_VALUE + - **Release Branch**: `${{ steps.create-release.outputs.branch_name }}` + - **Related Ticket**: [${{ github.event.inputs.release_ticket_id }}](https://linear.app/rudderstack/issue/${{ github.event.inputs.release_ticket_id }}) + + --- + Please review and merge when ready. :rocket: - Linear Ticket: - https://linear.app/rudderstack/issue/${{ github.event.inputs.release_ticket_id }} - name: Delete hotfix release base branch continue-on-error: true diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index 39f2198b7..f4a43eaee 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -31,6 +31,11 @@ jobs: VERSION=${BRANCH_NAME#hotfix-} VERSION=${VERSION#release/} + # Extract the ticket ID (case-insensitive match for -SDK-) + RELEASE_TICKET_ID=$(echo "$BRANCH_NAME" | grep -oE '[sS][dD][kK]-[0-9]+') + + echo "release_ticket_id=$RELEASE_TICKET_ID" >> $GITHUB_OUTPUT + # Remove the -SDK- suffix case insensitively VERSION=$(echo "$VERSION" | awk '{sub(/-[sS][dD][kK]-[0-9]+$/, ""); print}') @@ -104,8 +109,20 @@ jobs: source_branch: 'main' destination_branch: 'develop' github_token: ${{ secrets.PAT }} - pr_title: 'chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}' - pr_body: ':crown: *An automated PR*' + pr_title: 'chore(release): merge main into develop after release v${{ steps.extract-version.outputs.release_version }} [${{ steps.extract-version.outputs.release_ticket_id }}]' + pr_body: | + :crown: **Automated Post-Release PR** + + This pull request was created automatically by the GitHub Actions workflow. It merges changes from the `main` branch into the `develop` branch after a release has been completed. + + This ensures that the `develop` branch stays up to date with all release-related changes from the `main` branch. + + ### Details + - **Release Version**: v${{ steps.extract-version.outputs.release_version }} + - **Related Ticket**: [${{ steps.extract-version.outputs.release_ticket_id }}](https://linear.app/rudderstack/issue/${{ steps.extract-version.outputs.release_ticket_id }}) + + --- + Please review and merge it before closing the release ticket. :rocket: - name: Send message to Slack channel id: slack