Renamed authToken.
This commit is contained in:
@@ -33,23 +33,15 @@ runs:
|
|||||||
# Trim whitespace
|
# Trim whitespace
|
||||||
TGZ_PATH=$(echo "$TGZ_PATH" | xargs)
|
TGZ_PATH=$(echo "$TGZ_PATH" | xargs)
|
||||||
|
|
||||||
echo "Original path: '${{ inputs.tgz }}'"
|
|
||||||
echo "Trimmed path: '$TGZ_PATH'"
|
|
||||||
echo "First character: '${TGZ_PATH:0:1}'"
|
|
||||||
|
|
||||||
if [[ ! "$TGZ_PATH" =~ ^[./~] ]]; then
|
if [[ ! "$TGZ_PATH" =~ ^[./~] ]]; then
|
||||||
echo "Path does not start with . / or ~, adding ./ prefix"
|
echo "Path does not start with . / or ~, adding ./ prefix"
|
||||||
TGZ_PATH="./$TGZ_PATH"
|
TGZ_PATH="./$TGZ_PATH"
|
||||||
else
|
|
||||||
echo "Path already starts with . / or ~, no prefix needed"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Final path: '$TGZ_PATH'"
|
|
||||||
|
|
||||||
# Configure npm authentication for the registry (scoped to project)
|
# Configure npm authentication for the registry (scoped to project)
|
||||||
REGISTRY_PATH=$(echo "${{ inputs.registry }}" | sed -E 's|https?://||')
|
REGISTRY_PATH=$(echo "${{ inputs.registry }}" | sed -E 's|https?://||')
|
||||||
npm config set --location=project registry "${{ inputs.registry }}"
|
npm config set --location=project registry "${{ inputs.registry }}"
|
||||||
npm config set --location=project "//${REGISTRY_PATH}:_apiKey" "${{ inputs.apiKey }}"
|
npm config set --location=project "//${REGISTRY_PATH}:_authToken" "${{ inputs.apiKey }}"
|
||||||
|
|
||||||
echo "Publishing $TGZ_PATH to ${{ inputs.registry }}"
|
echo "Publishing $TGZ_PATH to ${{ inputs.registry }}"
|
||||||
npm publish --location=project "$TGZ_PATH" --access ${{ inputs.access }}
|
npm publish --location=project "$TGZ_PATH" --access ${{ inputs.access }}
|
||||||
|
|||||||
Reference in New Issue
Block a user