Skip to content

Commit

Permalink
Hack around rebar3 compiling for version
Browse files Browse the repository at this point in the history
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
erlang/rebar3#2865 (comment)
  • Loading branch information
paulo-ferraz-oliveira committed Feb 22, 2024
1 parent a23b1fc commit 5d112db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion src/setup-beam.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 5d112db

Please sign in to comment.