From 3142cc7ec8179bfd97124363c817818249ef47af Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Thu, 16 Nov 2023 22:58:16 +0100 Subject: [PATCH 1/2] feat: allows to skip node or yarn installation --- lib/language_pack/ruby.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/language_pack/ruby.rb b/lib/language_pack/ruby.rb index d03b9ac6c..e71744900 100644 --- a/lib/language_pack/ruby.rb +++ b/lib/language_pack/ruby.rb @@ -1013,7 +1013,7 @@ def pg_adapters # @note execjs will blow up if no JS RUNTIME is detected and is loaded. # @return [Array] the node.js binary path if we need it or an empty Array def add_node_js_binary - return [] if node_js_preinstalled? + return [] if node_js_preinstalled? || env("HEROKU_SKIP_NODE_INSTALL") if Pathname(build_path).join("package.json").exist? || bundler.has_gem?('execjs') || @@ -1045,7 +1045,7 @@ def add_node_js_binary end def add_yarn_binary - return [] if yarn_preinstalled? + return [] if yarn_preinstalled? || env("HEROKU_SKIP_NODE_INSTALL") if Pathname(build_path).join("yarn.lock").exist? || bundler.has_gem?('webpacker') From 2dfd45296ab0e184d72aeebb3b74f3bf7e737a0b Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:09:21 +0100 Subject: [PATCH 2/2] adds changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e79994251..1b7887ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Main (unreleased) +- Apps with the environment variable `HEROKU_SKIP_NODE_INSTALL=1` set will no longer install auto-install nodejs and yarn. + ## v262 (2023/11/08) - Warn when relying on default Node.js or Yarn versions (https://github.com/heroku/heroku-buildpack-ruby/pull/1401)