diff --git a/setup-r/action.yml b/setup-r/action.yml index 6dc6b555a..0ba1ba51e 100644 --- a/setup-r/action.yml +++ b/setup-r/action.yml @@ -27,6 +27,10 @@ inputs: default: 'default' install-r: default: true + windows-path-include-mingw: + description: 'If "true" put the 64 bit mingw directory from Rtools on the + PATH for Windows builds' + default: true outputs: installed-r-version: description: 'The full R version installed' diff --git a/setup-r/lib/installer.js b/setup-r/lib/installer.js index 4cccc441a..1d2a95343 100644 --- a/setup-r/lib/installer.js +++ b/setup-r/lib/installer.js @@ -330,11 +330,15 @@ function acquireRtools(version) { } if (rtools4) { core.addPath(`C:\\rtools40\\usr\\bin`); - core.addPath(`C:\\rtools40\\mingw64\\bin`); + if (core.getInput("windows-path-include-mingw")) { + core.addPath(`C:\\rtools40\\mingw64\\bin`); + } } else { core.addPath(`C:\\Rtools\\bin`); - core.addPath(`C:\\Rtools\\mingw_64\\bin`); + if (core.getInput("windows-path-include-mingw")) { + core.addPath(`C:\\Rtools\\mingw_64\\bin`); + } } }); } diff --git a/setup-r/src/installer.ts b/setup-r/src/installer.ts index 00c9d0056..ac999a483 100644 --- a/setup-r/src/installer.ts +++ b/setup-r/src/installer.ts @@ -319,10 +319,14 @@ async function acquireRtools(version: string) { } if (rtools4) { core.addPath(`C:\\rtools40\\usr\\bin`); - core.addPath(`C:\\rtools40\\mingw64\\bin`); + if (core.getInput("windows-path-include-mingw")) { + core.addPath(`C:\\rtools40\\mingw64\\bin`); + } } else { core.addPath(`C:\\Rtools\\bin`); - core.addPath(`C:\\Rtools\\mingw_64\\bin`); + if (core.getInput("windows-path-include-mingw")) { + core.addPath(`C:\\Rtools\\mingw_64\\bin`); + } } }