Skip to content

Commit 0b3329e

Browse files
committed
Workaround for auto_activate_base deprecation
1 parent 7470d07 commit 0b3329e

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

dist/setup/index.js

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/conda.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,45 @@ export async function applyCondaConfiguration(
240240
options,
241241
);
242242
}
243+
// auto_activate_base was renamed to auto_activate in 25.5.0
244+
core.info(`auto_activate: ${inputs.condaConfig.auto_activate_base}`);
245+
try {
246+
// 25.5.0+
247+
await condaCommand(
248+
[
249+
"config",
250+
"--set",
251+
"auto_activate",
252+
inputs.condaConfig.auto_activate_base,
253+
],
254+
inputs,
255+
options,
256+
);
257+
} catch (err) {
258+
try {
259+
// <25.5.0
260+
await condaCommand(
261+
[
262+
"config",
263+
"--set",
264+
"auto_activate_base",
265+
inputs.condaConfig.auto_activate_base,
266+
],
267+
inputs,
268+
options,
269+
);
270+
} catch (err2) {
271+
core.warning(err2 as Error);
272+
}
273+
}
243274

244275
// All other options are just passed as their string representations
245276
for (const [key, value] of configEntries) {
246277
if (
247278
value.trim().length === 0 ||
248279
key === "channels" ||
249-
key === "pkgs_dirs"
280+
key === "pkgs_dirs" ||
281+
key === "auto_activate_base"
250282
) {
251283
continue;
252284
}

0 commit comments

Comments
 (0)