79726786

Date: 2025-08-06 03:38:40
Score: 2.5
Natty:
Report link

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?

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Kavita