Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BFSY-290 Update auth for npm >= 10 #1276

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/dpl/providers/npm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def npmrc_path
end

def npmrc
if npm_version =~ /^1/ || auth_method == 'auth'
npm_version_major = npm_version.split('.').first.to_i
if npm_version_major >= 10
"//#{auth_endpoint}/:_auth=#{api_token}\nemail = #{email}"
elsif npm_version =~ /^1/ || auth_method == 'auth'
"_auth = #{api_token}\nemail = #{email}"
else
"//#{auth_endpoint}/:_authToken=#{api_token}"
Expand Down
2 changes: 1 addition & 1 deletion lib/dpl/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Dpl
VERSION = '2.0.3.beta.5'
VERSION = '2.0.4.beta'
end