From 5d112db3cb446a057716c7209766b51e166f7f43 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Thu, 22 Feb 2024 22:00:57 +0000 Subject: [PATCH] Hack around rebar3 compiling for `version` What are we fixing? If you're with'ing "version-file": ".tool-versions" after you _use_ "actions/checkout", it's likely `rebar3` from `setup-beam` is compiling your project just to output its version This commit prevents that as per https://github.com/erlang/rebar3/issues/2865#issuecomment-1958608973 --- dist/index.js | 3 ++- src/setup-beam.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index a22c782a..036989b5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10711,7 +10711,8 @@ async function install(toolName, opts) { fs.chmodSync(newPath, 0o755) }, reportVersion: () => { - const cmd = 'rebar3' + const cmd = + 'REBAR_GLOBAL_CONFIG_DIR=/fake-dir REBAR_CONFIG=fake.config rebar3' const args = ['version'] return [cmd, args] diff --git a/src/setup-beam.js b/src/setup-beam.js index d31e7ec8..245d9217 100644 --- a/src/setup-beam.js +++ b/src/setup-beam.js @@ -880,7 +880,8 @@ async function install(toolName, opts) { fs.chmodSync(newPath, 0o755) }, reportVersion: () => { - const cmd = 'rebar3' + const cmd = + 'REBAR_GLOBAL_CONFIG_DIR=/fake-dir REBAR_CONFIG=fake.config rebar3' const args = ['version'] return [cmd, args]