From 9da6692c39303d1e2b9b8cfb3c2a1a7db3c03e92 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Fri, 3 Nov 2023 14:23:46 +0100 Subject: [PATCH] Fix update tag script to checkout to the target branch --- .github/workflows/release.yml | 4 +--- scripts/update-tag.sh | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95bf4d1b7..9b51190f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,13 +31,11 @@ jobs: - name: Commit & push run: | - echo "Tag name from github.ref_name: ${{ github.event.release.target_commitish }}" ./scripts/commit-code.sh ${{ github.event.release.target_commitish }} - name: Update tag run: | - echo "Tag name from github.ref_name: ${{ github.event.release.tag_name }}" - ./scripts/update-tag.sh ${{ github.event.release.tag_name }} + ./scripts/update-tag.sh ${{ github.event.release.tag_name }} ${{ github.event.release.target_commitish }} - name: Release run: make releaseCocoaPods diff --git a/scripts/update-tag.sh b/scripts/update-tag.sh index 20cce25a0..ad5bff5b7 100755 --- a/scripts/update-tag.sh +++ b/scripts/update-tag.sh @@ -3,12 +3,13 @@ set -euo pipefail CURRENT_TAG="$1" TEMP_TAG="${CURRENT_TAG}-temp" +GITHUB_BRANCH="${2}" echo "Going to push the tag changes." git config --global user.name 'PostHog Github Bot' git config --global user.email 'github-bot@posthog.com' git fetch -git checkout ${CURRENT_TAG} +git checkout ${GITHUB_BRANCH} # Create a new temporary tag after pushing the changes from the previous tag (bump version) git tag -a ${TEMP_TAG} -m "${TEMP_TAG}" # Remove the current tag