if you're looking to not use jfrog here:
- name: Fetch Auth token
id: generate-artifactory-auth-token
# Fetch the _authToken from Artifactory by doing a legacy login
run: |
AUTH_TOKEN=$(curl -s -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASSWORD}" \
-X PUT "${ARTIFACTORY_REGISTRY}/-/user/org.couchdb.user:${ARTIFACTORY_USER}" \
-H "Content-Type: application/json" \
-d "{\"name\": \"${ARTIFACTORY_USER}\", \"password\": \"${ARTIFACTORY_PASSWORD}\", \"email\": \"${ARTIFACTORY_EMAIL}\"}" \
| jq -r '.token')
echo "AUTH_TOKEN=${AUTH_TOKEN}" >> $GITHUB_OUTPUT
echo "✅ Auth token generated successfully"
- name: Create .npmrc a ci
run: |
cat > .npmrc <<EOF
... register your registry scopes
//your-registry-here/:_authToken=${{ steps.generate-artifactory-auth-token.outputs.AUTH_TOKEN }}
See this post
cc: How to set npm credentials using `npm login` without reading from stdin?