Commit 991c90d 1 parent 7986ff1 commit 991c90d Copy full SHA for 991c90d
File tree 2 files changed +9
-1
lines changed
npm_and_yarn/lib/dependabot/npm_and_yarn
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ bundle install
47
47
COPY --chown=dependabot:dependabot updater/config/.yarnrc updater/config/.npmrc $DEPENDABOT_HOME/
48
48
49
49
# For Yarn Berry we can set this via an environment variable
50
- ENV YARN_HTTPS_CA_FILE_PATH=/etc/ssl/certs/ca-certificates.crt
51
50
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
52
51
53
52
# END: HACKY WORKAROUND FOR NPM GIT INSTALLS SPAWNING CHILD PROCESS
Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ def self.run_yarn_commands(*commands)
29
29
if ( https_proxy = ENV . fetch ( "HTTPS_PROXY" , false ) )
30
30
SharedHelpers . run_shell_command ( "yarn config set httpsProxy #{ https_proxy } " )
31
31
end
32
+ if ( ca_file_path = ENV . fetch ( "NODE_EXTRA_CA_CERTS" , false ) )
33
+ output = SharedHelpers . run_shell_command ( "yarn --version" )
34
+ major_version = Version . new ( output ) . major
35
+ if major_version >= 4
36
+ SharedHelpers . run_shell_command ( "yarn config set httpsCaFilePath #{ ca_file_path } " )
37
+ else
38
+ SharedHelpers . run_shell_command ( "yarn config set caFilePath #{ ca_file_path } " )
39
+ end
40
+ end
32
41
commands . each { |cmd | SharedHelpers . run_shell_command ( cmd ) }
33
42
end
34
43
end
You can’t perform that action at this time.
0 commit comments