File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 5959 VERSION="$INPUT_TAG"
6060 echo "Input tag '$INPUT_TAG' is valid SemVer. Using version '$VERSION'."
6161 # Let npm publish determine the tag (latest or pre-release tag)
62+ NPM_TAG_ARG=""
6263 else
6364 # Input tag is not SemVer, treat as branch/tag name
6465 echo "Input tag '$INPUT_TAG' is not valid SemVer. Generating pre-release version."
6768 # Construct the version string: major.minor.0-tag.pipeline
6869 VERSION="${MAJOR}.${MINOR}.0-${SANITIZED_TAG}.${PIPELINE_ID}"
6970 echo "Generated version: $VERSION"
70- # Publish with a tag derived from the sanitized input tag - npm handles this automatically now
71+ # Explicitly publish with a tag derived from the sanitized input tag
72+ NPM_TAG_ARG="--tag ${SANITIZED_TAG}"
7173 fi
7274
7375 # Update package.json version
7779 head package.json # Keep for debugging output
7880 git config user.name "${GITHUB_ACTOR}"
7981 git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
80- echo "Publishing to NPM version '$VERSION'. Tag will be automatically determined by npm. "
82+ echo "Publishing to NPM version '$VERSION' with tag arguments: '$NPM_TAG_ARG' "
8183 # Note: The space before $NPM_TAG_ARG is important if it's non-empty
82- # Npm automatically determines the tag (latest for standard, pre-id for pre-releases)
83- npm publish
84+ npm publish $NPM_TAG_ARG
8485 shell : bash
8586 env :
8687 GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments