Skip to content

Commit 35d1405

Browse files
committed
Merge branch 'develop' for 2.1.1 release
2 parents 9d63dfe + 72a8686 commit 35d1405

18 files changed

+221
-25
lines changed

.github/workflows/example-10.yml

+16
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,24 @@ jobs:
8282
mamba-version: ${{ matrix.mamba-version }}
8383
use-mamba: true
8484
python-version: ${{ matrix.python-version }}
85+
clean-patched-environment-file: false
86+
8587
- run: |
8688
mamba info
8789
mamba list
8890
python -VV
8991
printenv | sort
92+
- name: verify unpatched environment.yml is reported and not cleaned
93+
if: contains(matrix.environment-file, '.yml') && !matrix.python-version
94+
run: |
95+
set -eux
96+
ls '${{ steps.setup-miniconda.outputs.environment-file }}'
97+
ls '${{ matrix.environment-file }}'
98+
diff -s '${{ steps.setup-miniconda.outputs.environment-file }}' '${{ matrix.environment-file }}' | grep 'are identical'
99+
- name: verify patched output is reported, correct, and not cleaned
100+
if: contains(matrix.environment-file, '.yml') && matrix.python-version
101+
run: |
102+
set -eux
103+
if [ "$(diff '${{ steps.setup-miniconda.outputs.environment-file }}' '${{ matrix.environment-file }}' | grep -c 'python=${{ matrix.python-version }}')" -ge 1 ] ; then echo ok ; else exit 1 ; fi
104+
python --version | grep "Python ${{ matrix.python-version }}"
105+
awk '/- conda-forge/,/- defaults/' '${{ steps.setup-miniconda.outputs.environment-file }}'

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# CHANGELOG
22

3+
## [v2.1.1] (unreleased)
4+
5+
### Features
6+
7+
- [#163] leaves the patched `setup-miniconda-patched-{environment.yml}` in-place
8+
if `clean-patched-environment-file: false` is given (otherwise cleans up after
9+
itself)
10+
- [#163] adds action outputs `environment-file`, `environment-file-content` and
11+
`environment-file-was-patched`
12+
13+
### Fixes
14+
15+
- [#161] restores proper ordering of `channels` when `environment-file` is
16+
patched
17+
- [#163] if necessary, writes `setup-miniconda-patched-environment.yml` to the
18+
same location to work with relative paths, e.g. `pip: ["-r requirements.txt"]`
19+
20+
[v2.1.1]: https://github.com/conda-incubator/setup-miniconda/releases/tag/v2.1.0
21+
[#161]: https://github.com/conda-incubator/setup-miniconda/pull/161
22+
[#163]: https://github.com/conda-incubator/setup-miniconda/pull/163
23+
324
## [v2.1.0] (2021-03-29)
425

526
### Features

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ A `conda-build-version` or `mamba-version` may be provided to install into
1616
The base `condabin/` folder is added to `$PATH` and shell integration is
1717
initialized across all platforms.
1818

19-
By default, this action will then create, and activate an environment by one of:
19+
By default, this action will then create, and _activate_, an environment by one
20+
of:
2021

2122
- creating a mostly-empty `test` environment, containing only the latest
2223
`python-version` and its dependencies
2324
- creating an `test` environment described in a given `environment-file`:
2425
- an `environment.yml`-like file (which can be patched with `python-version`)
26+
- the patched environment will be cleaned up unless
27+
`clean-patched-environment-file: false` is given
2528
- a [lockfile](#example-7-explicit-specification)
2629

2730
This action correctly handles activation of environments and offers the
@@ -118,9 +121,9 @@ activate the `base` environment. This encourages the practice of not using the
118121
`base` environment to install packages used for the workflow and leave the
119122
`base` environment untouched, with only `conda` (and/or `mamba`) in it.
120123

121-
## Inputs
124+
## Inputs and outputs
122125

123-
For a full list of available inputs for this action see
126+
For a full list of available _inputs_ and _outputs_ for this action see
124127
[action.yml](action.yml).
125128

126129
### Use a different environment name or path

action.yml

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
name: "Setup Miniconda"
22
author: Gonzalo Peña-Castellanos (@goanpeca)
33
description: "Set up Conda package and environment manager with Miniconda."
4+
5+
runs:
6+
using: "node12"
7+
main: "dist/setup/index.js"
8+
post: "dist/delete/index.js"
9+
post-if: "success()"
10+
11+
branding:
12+
icon: "code"
13+
color: "green"
14+
15+
outputs:
16+
environment-file:
17+
description: "The full path to the environment-file used"
18+
environment-file-content:
19+
description: "The content of the environment-file used"
20+
environment-file-was-patched:
21+
description: "Whether a patched environment-file was made due to inputs"
22+
423
inputs:
524
installer-url:
625
description:
@@ -220,11 +239,8 @@ inputs:
220239
GitHub-hosted runners are "x86" and "x64". Default is "x64".'
221240
required: false
222241
default: "x64"
223-
runs:
224-
using: "node12"
225-
main: "dist/setup/index.js"
226-
post: "dist/delete/index.js"
227-
post-if: "success()"
228-
branding:
229-
icon: "code"
230-
color: "green"
242+
clean-patched-environment-file:
243+
description:
244+
"Whether a patched environment-file (if created) should be cleaned"
245+
required: false
246+
default: "true"

dist/delete/index.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
11611161
return result;
11621162
};
11631163
Object.defineProperty(exports, "__esModule", { value: true });
1164-
exports.PYTHON_SPEC = exports.WIN_PERMS_FOLDERS = exports.PROFILES = exports.ENV_VAR_CONDA_PKGS = exports.CONDA_CACHE_FOLDER = exports.CONDARC_PATH = exports.BOOTSTRAP_CONDARC = exports.FORCED_ERRORS = exports.IGNORED_WARNINGS = exports.MAMBA_SUBCOMMANDS = exports.KNOWN_EXTENSIONS = exports.BASE_ENV_NAMES = exports.MINIFORGE_DEFAULT_VERSION = exports.MINIFORGE_DEFAULT_VARIANT = exports.MINIFORGE_URL_PREFIX = exports.OS_NAMES = exports.MINIFORGE_ARCHITECTURES = exports.MINICONDA_ARCHITECTURES = exports.MINICONDA_BASE_URL = exports.IS_UNIX = exports.IS_LINUX = exports.IS_MAC = exports.IS_WINDOWS = exports.MINICONDA_DIR_PATH = void 0;
1164+
exports.OUTPUT_ENV_FILE_WAS_PATCHED = exports.OUTPUT_ENV_FILE_CONTENT = exports.OUTPUT_ENV_FILE_PATH = exports.PYTHON_SPEC = exports.WIN_PERMS_FOLDERS = exports.PROFILES = exports.ENV_VAR_CONDA_PKGS = exports.CONDA_CACHE_FOLDER = exports.CONDARC_PATH = exports.BOOTSTRAP_CONDARC = exports.FORCED_ERRORS = exports.IGNORED_WARNINGS = exports.MAMBA_SUBCOMMANDS = exports.KNOWN_EXTENSIONS = exports.BASE_ENV_NAMES = exports.MINIFORGE_DEFAULT_VERSION = exports.MINIFORGE_DEFAULT_VARIANT = exports.MINIFORGE_URL_PREFIX = exports.OS_NAMES = exports.MINIFORGE_ARCHITECTURES = exports.MINICONDA_ARCHITECTURES = exports.MINICONDA_BASE_URL = exports.IS_UNIX = exports.IS_LINUX = exports.IS_MAC = exports.IS_WINDOWS = exports.MINICONDA_DIR_PATH = void 0;
11651165
const os = __importStar(__webpack_require__(87));
11661166
const path = __importStar(__webpack_require__(622));
11671167
//-----------------------------------------------------------------------
@@ -1288,6 +1288,18 @@ exports.WIN_PERMS_FOLDERS = [
12881288
* @see https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications
12891289
*/
12901290
exports.PYTHON_SPEC = /^(.*::)?python($|\s\=\<\>\!\|)/i;
1291+
/**
1292+
* Output name for the effective environment-file path used.
1293+
*/
1294+
exports.OUTPUT_ENV_FILE_PATH = "environment-file";
1295+
/**
1296+
* Output name for the effective environment-file file content used.
1297+
*/
1298+
exports.OUTPUT_ENV_FILE_CONTENT = "environment-file-content";
1299+
/**
1300+
* Output name for whether the effective environment-file file was patched.
1301+
*/
1302+
exports.OUTPUT_ENV_FILE_WAS_PATCHED = "environment-file-was-patched";
12911303

12921304

12931305
/***/ }),

dist/setup/index.js

+52-7
Original file line numberDiff line numberDiff line change
@@ -9358,7 +9358,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
93589358
return result;
93599359
};
93609360
Object.defineProperty(exports, "__esModule", { value: true });
9361-
exports.PYTHON_SPEC = exports.WIN_PERMS_FOLDERS = exports.PROFILES = exports.ENV_VAR_CONDA_PKGS = exports.CONDA_CACHE_FOLDER = exports.CONDARC_PATH = exports.BOOTSTRAP_CONDARC = exports.FORCED_ERRORS = exports.IGNORED_WARNINGS = exports.MAMBA_SUBCOMMANDS = exports.KNOWN_EXTENSIONS = exports.BASE_ENV_NAMES = exports.MINIFORGE_DEFAULT_VERSION = exports.MINIFORGE_DEFAULT_VARIANT = exports.MINIFORGE_URL_PREFIX = exports.OS_NAMES = exports.MINIFORGE_ARCHITECTURES = exports.MINICONDA_ARCHITECTURES = exports.MINICONDA_BASE_URL = exports.IS_UNIX = exports.IS_LINUX = exports.IS_MAC = exports.IS_WINDOWS = exports.MINICONDA_DIR_PATH = void 0;
9361+
exports.OUTPUT_ENV_FILE_WAS_PATCHED = exports.OUTPUT_ENV_FILE_CONTENT = exports.OUTPUT_ENV_FILE_PATH = exports.PYTHON_SPEC = exports.WIN_PERMS_FOLDERS = exports.PROFILES = exports.ENV_VAR_CONDA_PKGS = exports.CONDA_CACHE_FOLDER = exports.CONDARC_PATH = exports.BOOTSTRAP_CONDARC = exports.FORCED_ERRORS = exports.IGNORED_WARNINGS = exports.MAMBA_SUBCOMMANDS = exports.KNOWN_EXTENSIONS = exports.BASE_ENV_NAMES = exports.MINIFORGE_DEFAULT_VERSION = exports.MINIFORGE_DEFAULT_VARIANT = exports.MINIFORGE_URL_PREFIX = exports.OS_NAMES = exports.MINIFORGE_ARCHITECTURES = exports.MINICONDA_ARCHITECTURES = exports.MINICONDA_BASE_URL = exports.IS_UNIX = exports.IS_LINUX = exports.IS_MAC = exports.IS_WINDOWS = exports.MINICONDA_DIR_PATH = void 0;
93629362
const os = __importStar(__webpack_require__(87));
93639363
const path = __importStar(__webpack_require__(622));
93649364
//-----------------------------------------------------------------------
@@ -9485,6 +9485,18 @@ exports.WIN_PERMS_FOLDERS = [
94859485
* @see https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications
94869486
*/
94879487
exports.PYTHON_SPEC = /^(.*::)?python($|\s\=\<\>\!\|)/i;
9488+
/**
9489+
* Output name for the effective environment-file path used.
9490+
*/
9491+
exports.OUTPUT_ENV_FILE_PATH = "environment-file";
9492+
/**
9493+
* Output name for the effective environment-file file content used.
9494+
*/
9495+
exports.OUTPUT_ENV_FILE_CONTENT = "environment-file-content";
9496+
/**
9497+
* Output name for whether the effective environment-file file was patched.
9498+
*/
9499+
exports.OUTPUT_ENV_FILE_WAS_PATCHED = "environment-file-was-patched";
94889500

94899501

94909502
/***/ }),
@@ -13133,7 +13145,8 @@ function applyCondaConfiguration(inputs, options) {
1313313145
channels = options.envSpec.yaml.channels;
1313413146
}
1313513147
// LIFO: reverse order to preserve higher priority as listed in the option
13136-
for (const channel of channels.reverse()) {
13148+
// .slice ensures working against a copy
13149+
for (const channel of channels.slice().reverse()) {
1313713150
core.info(`Adding channel '${channel}'`);
1313813151
yield condaCommand(["config", "--add", "channels", channel], options);
1313913152
}
@@ -13632,6 +13645,7 @@ function parseInputs() {
1363213645
always_yes: "true",
1363313646
changeps1: "false",
1363413647
}),
13648+
cleanPatchedEnvironmentFile: core.getInput("clean-patched-environment-file"),
1363513649
});
1363613650
const errors = RULES.reduce((errors, rule) => {
1363713651
const msg = rule(inputs, inputs.condaConfig);
@@ -15870,6 +15884,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1587015884
Object.defineProperty(exports, "__esModule", { value: true });
1587115885
exports.ensureExplicit = void 0;
1587215886
const conda = __importStar(__webpack_require__(259));
15887+
const outputs = __importStar(__webpack_require__(405));
1587315888
/**
1587415889
* Install an environment from an explicit file generated `conda list --explicit`
1587515890
* or `conda-lock`
@@ -15878,9 +15893,13 @@ exports.ensureExplicit = {
1587815893
label: "conda create (from explicit)",
1587915894
provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { var _a, _b; return !!((_b = (_a = options.envSpec) === null || _a === void 0 ? void 0 : _a.explicit) === null || _b === void 0 ? void 0 : _b.length); }),
1588015895
condaArgs: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () {
15896+
var _c;
1588115897
if (inputs.pythonVersion) {
1588215898
throw Error(`'python-version: ${inputs.pythonVersion}' is incompatible with an explicit 'environmentFile`);
1588315899
}
15900+
if ((_c = options.envSpec) === null || _c === void 0 ? void 0 : _c.explicit) {
15901+
outputs.setEnvironmentFileOutputs(inputs.environmentFile, options.envSpec.explicit);
15902+
}
1588415903
return [
1588515904
"create",
1588615905
...conda.envCommandFlag(inputs),
@@ -18014,7 +18033,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1801418033
});
1801518034
};
1801618035
Object.defineProperty(exports, "__esModule", { value: true });
18017-
exports.setCacheVariable = exports.setPathVariables = void 0;
18036+
exports.setEnvironmentFileOutputs = exports.setCacheVariable = exports.setPathVariables = void 0;
1801818037
/**
1801918038
* Modify environment variables and action outputs.
1802018039
*/
@@ -18050,6 +18069,16 @@ function setCacheVariable(options) {
1805018069
});
1805118070
}
1805218071
exports.setCacheVariable = setCacheVariable;
18072+
/**
18073+
* Export the effective environment-file path
18074+
*/
18075+
function setEnvironmentFileOutputs(envFile, envContent, patched = false) {
18076+
core.setOutput(constants.OUTPUT_ENV_FILE_PATH, path.resolve(envFile));
18077+
core.setOutput(constants.OUTPUT_ENV_FILE_CONTENT, envContent);
18078+
core.setOutput(constants.OUTPUT_ENV_FILE_WAS_PATCHED, patched ? "true" : "false");
18079+
core.saveState(constants.OUTPUT_ENV_FILE_WAS_PATCHED, patched);
18080+
}
18081+
exports.setEnvironmentFileOutputs = setEnvironmentFileOutputs;
1805318082

1805418083

1805518084
/***/ }),
@@ -20557,6 +20586,18 @@ function setupMiniconda(inputs) {
2055720586
if (inputs.activateEnvironment) {
2055820587
yield core.group("Ensuring environment...", () => env.ensureEnvironment(inputs, options));
2055920588
}
20589+
if (core.getState(constants.OUTPUT_ENV_FILE_WAS_PATCHED)) {
20590+
yield core.group("Maybe cleaning up patched environment-file...", () => __awaiter(this, void 0, void 0, function* () {
20591+
const patchedEnv = core.getState(constants.OUTPUT_ENV_FILE_PATH);
20592+
if (inputs.cleanPatchedEnvironmentFile === "true") {
20593+
fs.unlinkSync(patchedEnv);
20594+
core.info(`Cleaned ${patchedEnv}`);
20595+
}
20596+
else {
20597+
core.info(`Leaving ${patchedEnv} in place`);
20598+
}
20599+
}));
20600+
}
2056020601
core.info("setup-miniconda ran successfully");
2056120602
});
2056220603
}
@@ -20616,13 +20657,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
2061620657
Object.defineProperty(exports, "__esModule", { value: true });
2061720658
exports.ensureYaml = void 0;
2061820659
const fs = __importStar(__webpack_require__(747));
20619-
const os = __importStar(__webpack_require__(87));
2062020660
const path = __importStar(__webpack_require__(622));
2062120661
const yaml = __importStar(__webpack_require__(414));
2062220662
const core = __importStar(__webpack_require__(470));
2062320663
const constants = __importStar(__webpack_require__(211));
2062420664
const conda = __importStar(__webpack_require__(259));
2062520665
const utils = __importStar(__webpack_require__(163));
20666+
const outputs = __importStar(__webpack_require__(405));
2062620667
/**
2062720668
* The current known providers of patches to `environment.yml`
2062820669
*
@@ -20689,13 +20730,17 @@ exports.ensureYaml = {
2068920730
}
2069020731
if (patchesApplied.length) {
2069120732
const patchedYaml = yaml.safeDump(Object.assign(Object.assign({}, yamlData), { dependencies }));
20692-
envFile = path.join(os.tmpdir(), "environment-patched.yml");
20733+
const origPath = path.resolve(inputs.environmentFile);
20734+
const origParent = path.dirname(origPath);
20735+
envFile = path.join(origParent, `setup-miniconda-patched-${path.basename(origPath)}`);
2069320736
core.info(`Making patched copy of 'environment-file: ${inputs.environmentFile}'`);
20694-
core.info(patchedYaml);
20737+
core.info(`Using: ${envFile}\n${patchedYaml}`);
2069520738
fs.writeFileSync(envFile, patchedYaml, "utf8");
20739+
outputs.setEnvironmentFileOutputs(envFile, yaml.safeDump(patchedYaml), true);
2069620740
}
2069720741
else {
2069820742
core.info(`Using 'environment-file: ${inputs.environmentFile}' as-is`);
20743+
outputs.setEnvironmentFileOutputs(envFile, fs.readFileSync(inputs.environmentFile, "utf-8"));
2069920744
}
2070020745
return [
2070120746
"env",
@@ -29955,7 +30000,7 @@ module.exports.safeLoad = safeLoad;
2995530000
/* 771 */
2995630001
/***/ (function(module) {
2995730002

29958-
module.exports = {"_args":[["cheerio@1.0.0-rc.3","/Users/gpenacastellanos/develop/conda-incubator/setup-miniconda"]],"_from":"cheerio@1.0.0-rc.3","_id":"cheerio@1.0.0-rc.3","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"cheerio@1.0.0-rc.3","name":"cheerio","escapedName":"cheerio","rawSpec":"1.0.0-rc.3","saveSpec":null,"fetchSpec":"1.0.0-rc.3"},"_requiredBy":["/get-hrefs"],"_resolved":"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz","_spec":"1.0.0-rc.3","_where":"/Users/gpenacastellanos/develop/conda-incubator/setup-miniconda","author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com","url":"mat.io"},"bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"dependencies":{"css-select":"~1.2.0","dom-serializer":"~0.1.1","entities":"~1.1.1","htmlparser2":"^3.9.1","lodash":"^4.15.0","parse5":"^3.0.1"},"description":"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server","devDependencies":{"benchmark":"^2.1.0","coveralls":"^2.11.9","expect.js":"~0.3.1","istanbul":"^0.4.3","jquery":"^3.0.0","jsdom":"^9.2.1","jshint":"^2.9.2","mocha":"^3.1.2","xyz":"~1.1.0"},"engines":{"node":">= 0.6"},"files":["index.js","lib"],"homepage":"https://github.com/cheeriojs/cheerio#readme","keywords":["htmlparser","jquery","selector","scraper","parser","html"],"license":"MIT","main":"./index.js","name":"cheerio","repository":{"type":"git","url":"git://github.com/cheeriojs/cheerio.git"},"scripts":{"test":"make test"},"version":"1.0.0-rc.3"};
30003+
module.exports = {"_args":[["cheerio@1.0.0-rc.3","/home/weg/projects/actions/setup-miniconda"]],"_from":"cheerio@1.0.0-rc.3","_id":"cheerio@1.0.0-rc.3","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"cheerio@1.0.0-rc.3","name":"cheerio","escapedName":"cheerio","rawSpec":"1.0.0-rc.3","saveSpec":null,"fetchSpec":"1.0.0-rc.3"},"_requiredBy":["/get-hrefs"],"_resolved":"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz","_spec":"1.0.0-rc.3","_where":"/home/weg/projects/actions/setup-miniconda","author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com","url":"mat.io"},"bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"dependencies":{"css-select":"~1.2.0","dom-serializer":"~0.1.1","entities":"~1.1.1","htmlparser2":"^3.9.1","lodash":"^4.15.0","parse5":"^3.0.1"},"description":"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server","devDependencies":{"benchmark":"^2.1.0","coveralls":"^2.11.9","expect.js":"~0.3.1","istanbul":"^0.4.3","jquery":"^3.0.0","jsdom":"^9.2.1","jshint":"^2.9.2","mocha":"^3.1.2","xyz":"~1.1.0"},"engines":{"node":">= 0.6"},"files":["index.js","lib"],"homepage":"https://github.com/cheeriojs/cheerio#readme","keywords":["htmlparser","jquery","selector","scraper","parser","html"],"license":"MIT","main":"./index.js","name":"cheerio","repository":{"type":"git","url":"git://github.com/cheeriojs/cheerio.git"},"scripts":{"test":"make test"},"version":"1.0.0-rc.3"};
2995930004

2996030005
/***/ }),
2996130006
/* 772 */

etc/example-environment-no-name.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
channels:
2+
- conda-forge
3+
- defaults
14
dependencies:
25
- black
36
- anaconda-client

etc/example-environment.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: anaconda-client-env
2+
channels:
3+
- conda-forge
4+
- defaults
25
dependencies:
3-
- black
46
- anaconda-client
7+
- pip
8+
- pip:
9+
- -r requirements.txt

etc/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
isort

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/conda.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ export async function applyCondaConfiguration(
126126
}
127127

128128
// LIFO: reverse order to preserve higher priority as listed in the option
129-
for (const channel of channels.reverse()) {
129+
// .slice ensures working against a copy
130+
for (const channel of channels.slice().reverse()) {
130131
core.info(`Adding channel '${channel}'`);
131132
await condaCommand(["config", "--add", "channels", channel], options);
132133
}

0 commit comments

Comments
 (0)