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 59
59
VERSION="$INPUT_TAG"
60
60
echo "Input tag '$INPUT_TAG' is valid SemVer. Using version '$VERSION'."
61
61
# Let npm publish determine the tag (latest or pre-release tag)
62
+ NPM_TAG_ARG=""
62
63
else
63
64
# Input tag is not SemVer, treat as branch/tag name
64
65
echo "Input tag '$INPUT_TAG' is not valid SemVer. Generating pre-release version."
67
68
# Construct the version string: major.minor.0-tag.pipeline
68
69
VERSION="${MAJOR}.${MINOR}.0-${SANITIZED_TAG}.${PIPELINE_ID}"
69
70
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}"
71
73
fi
72
74
73
75
# Update package.json version
77
79
head package.json # Keep for debugging output
78
80
git config user.name "${GITHUB_ACTOR}"
79
81
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' "
81
83
# 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
84
85
shell : bash
85
86
env :
86
87
GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments