diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 0d6cf722..4827c833 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -34,11 +34,21 @@ jobs: - name: Normalize release PR pyproject prerelease version if: ${{ steps.release.outputs.prs_created == 'true' }} - env: - RELEASE_PR_BRANCH: release-please--branches--${{ github.ref_name }} run: | set -euo pipefail + BASE_RELEASE_PR_BRANCH="release-please--branches--${{ github.ref_name }}" + COMPONENT_RELEASE_PR_BRANCH="${BASE_RELEASE_PR_BRANCH}--components--adcp" + + if git ls-remote --exit-code --heads origin "${COMPONENT_RELEASE_PR_BRANCH}" >/dev/null 2>&1; then + RELEASE_PR_BRANCH="${COMPONENT_RELEASE_PR_BRANCH}" + elif git ls-remote --exit-code --heads origin "${BASE_RELEASE_PR_BRANCH}" >/dev/null 2>&1; then + RELEASE_PR_BRANCH="${BASE_RELEASE_PR_BRANCH}" + else + echo "No release PR branch found to normalize" + exit 0 + fi + git fetch origin "${RELEASE_PR_BRANCH}:${RELEASE_PR_BRANCH}" git switch "${RELEASE_PR_BRANCH}" diff --git a/release-please-config.json b/release-please-config.json index 89e087ad..da32d0d4 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -6,6 +6,7 @@ "changelog-path": "CHANGELOG.md", "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": false, + "include-component-in-tag": false, "versioning": "prerelease", "prerelease": true, "prerelease-type": "beta"