diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 48d5f7374e..86bbc16f32 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,15 +43,17 @@ jobs: run: | # Get the latest release tag LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) - echo "Publishing version: $LATEST_TAG" - - # Checkout the latest tag - git checkout $LATEST_TAG - # Clean any untracked files that differ from the latest tag and reset any changes + # Force clean the working directory and reset any changes + echo "Cleaning working directory and resetting any changes" git clean -fd - git reset --hard $LATEST_TAG + git reset --hard HEAD + # Force checkout the latest tag + echo "Checking out latest tag: $LATEST_TAG" + git checkout -f $LATEST_TAG + + echo "Publishing version: $LATEST_TAG" npx lerna publish from-git --yes --dist-tag latest env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}