Skip to content

Commit

Permalink
chore: update lerna-version-ci.sh script to fix issue when there are …
Browse files Browse the repository at this point in the history
…no tags (#864)
  • Loading branch information
jonathannorris authored May 29, 2024
1 parent bd3ac04 commit 1ff7fb9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/lerna-version-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,20 @@ yarn lerna version --force-publish=$PACKAGES --message "chore(release): publish"
RELEASE_TAGS=$(git tag --points-at HEAD)

# run yarn and add any lockfile changes
echo -e "::info::Run yarn"
yarn --no-immutable
git add yarn.lock

# amend the previous commit with the new lock file. Now the SHA is different and the tags are wrong
echo -e "::info::Amend previous commit"
git commit --amend --no-edit --no-verify

# fix the tags by iterating over them and moving them to the new commit
while IFS= read -r line; do
git tag -f "$line" -m "$line"
done <<< "$RELEASE_TAGS"
echo -e "::info::Fix the tags: $RELEASE_TAGS"
if [ -n "$RELEASE_TAGS" ]; then
while IFS= read -r line; do
git tag -f "$line" -m "$line"
done <<< "$RELEASE_TAGS"
else
echo -e "::info::No tags to fix."
fi

0 comments on commit 1ff7fb9

Please sign in to comment.