fix: add OTP prompt for npm publish to enhance security

This commit is contained in:
2026-03-21 17:58:00 +05:30
parent 8bbd741bfa
commit 8368cd8015
+7 -2
View File
@@ -30,8 +30,13 @@ if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
exit 0
fi
# Publish to npm
npm publish
# Prompt for OTP
read -p "Enter npm OTP (leave blank if not using 2FA): " otp
if [[ -n "$otp" ]]; then
npm publish --otp "$otp"
else
npm publish
fi
# Push git commits and tags
git push && git push --tags