This commit is contained in:
2026-01-05 10:02:50 -08:00
parent d1a57aef46
commit 12ea8a669d

View File

@@ -30,10 +30,22 @@ runs:
run: | run: |
# Ensure path starts with ./ so npm recognizes it as a file path # Ensure path starts with ./ so npm recognizes it as a file path
TGZ_PATH="${{ inputs.tgz }}" TGZ_PATH="${{ inputs.tgz }}"
# Trim whitespace
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"
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 }}"