diff --git a/dist/setup/index.js b/dist/setup/index.js index 77635470..2d140758 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -47284,8 +47284,19 @@ function applyCondaConfiguration(inputs, options) { // LIFO: reverse order to preserve higher priority as listed in the option // .slice ensures working against a copy for (const channel of channels.slice().reverse()) { - core.info(`Adding channel '${channel}'`); - yield condaCommand(["config", "--add", "channels", channel], options); + if (channel === "nodefaults") { + core.info("Removing channel defaults"); + try { + yield condaCommand(["config", "--remove", "channels", "defaults"], options); + } + catch (err) { + core.info("Removing defaults raised an error -- it was probably not present."); + } + } + else { + core.info(`Adding channel '${channel}'`); + yield condaCommand(["config", "--add", "channels", channel], options); + } } // All other options are just passed as their string representations for (const [key, value] of configEntries) { diff --git a/src/conda.ts b/src/conda.ts index 3cf527a9..e32aa45d 100644 --- a/src/conda.ts +++ b/src/conda.ts @@ -126,8 +126,22 @@ export async function applyCondaConfiguration( // LIFO: reverse order to preserve higher priority as listed in the option // .slice ensures working against a copy for (const channel of channels.slice().reverse()) { - core.info(`Adding channel '${channel}'`); - await condaCommand(["config", "--add", "channels", channel], options); + if (channel === "nodefaults") { + core.info("Removing channel defaults"); + try { + await condaCommand( + ["config", "--remove", "channels", "defaults"], + options, + ); + } catch (err) { + core.info( + "Removing defaults raised an error -- it was probably not present.", + ); + } + } else { + core.info(`Adding channel '${channel}'`); + await condaCommand(["config", "--add", "channels", channel], options); + } } // All other options are just passed as their string representations