The personal finance app for everyone (by everyone)
Ruby
Fix patch release branch naming (#3863)
Sure Admin (bot)6317e40000f3
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.ymlindex b005a3b3ac..96a26818ed 100644--- a/.github/workflows/publish.yml+++ b/.github/workflows/publish.yml@@ -392,14 +392,14 @@ jobs:contents: writesteps:- - name: Create/update minor release branch+ - name: Create/update patch release branchenv:TAG_NAME: ${{ github.ref_name }}GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}run: |set -euo pipefail- BRANCH_NAME="$(echo "$TAG_NAME" | sed -E 's/^v([0-9]+)\.([0-9]+)\..*/v\1.\2-release-branch/')"+ BRANCH_NAME="$(echo "$TAG_NAME" | sed -E 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)(-.*)?$/v\1.\2.\3-release-branch/')"SHA="${GITHUB_SHA}"echo "Updating ${BRANCH_NAME} -> ${SHA}"@@ -443,7 +443,8 @@ jobs:# Prefer the matching release branch over main. Do not select arbitrary# feature or PR branches that happen to contain the tagged commit.SOURCE_BRANCH="main"- RELEASE_BRANCH="$(printf '%s\n' "$TAG_NAME" | sed -E 's/^v([0-9]+)\.([0-9]+)\..*/v\1.\2-release-branch/')"+ RELEASE_BRANCH="$(printf '%s\n' "$TAG_NAME" | sed -E 's/^v([0-9]+)\.([0-9]+)\.([0-9]+)(-.*)?$/v\1.\2.\3-release-branch/')"+ LEGACY_RELEASE_BRANCH="$(printf '%s\n' "$TAG_NAME" | sed -E 's/^v([0-9]+)\.([0-9]+)\..*/v\1.\2-release-branch/')"for branch in $BRANCHES; doif [ "$branch" = "$RELEASE_BRANCH" ]; then@@ -454,7 +455,7 @@ jobs:if [ "$SOURCE_BRANCH" = "main" ]; thenfor branch in $BRANCHES; do- if [[ "$branch" =~ ^v[0-9]+\.[0-9]+-release-branch$ ]]; then+ if [ "$branch" = "$LEGACY_RELEASE_BRANCH" ]; thenSOURCE_BRANCH="$branch"breakfi