diff --git a/CHANGELOG.md b/CHANGELOG.md index 7215ac7f..aeba51a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # CHANGELOG +## [v2.1.0][] () + +## Tasks + +- [#115][] add extra information on default environment activation. + +[v2.1.0]: https://github.com/conda-incubator/setup-miniconda/releases/tag/v2.1.0 +[#115]: https://github.com/conda-incubator/setup-miniconda/pull/115 + ## [v2.0.1][] (2020-11-29) ## Fixes diff --git a/README.md b/README.md index 2734b929..a4ad0ab7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ ![Caching Example](https://github.com/conda-incubator/setup-miniconda/workflows/Caching%20Example/badge.svg?branch=master) ![Linting](https://github.com/conda-incubator/setup-miniconda/workflows/Linting/badge.svg?branch=master) - This action sets up a [Miniconda](https://docs.conda.io/en/latest/miniconda.html) installation to use the [Conda](https://docs.conda.io/projects/conda/en/latest/) package and @@ -26,6 +25,36 @@ possibility of automatically activating the test environment on all shells. > See the **[IMPORTANT](#IMPORTANT)** notes on additional information on environment activation. +## Environment activation + +This action will by default will not activate the `base`environment and activate an environment called `test`. +This enforces the idea of not using the `base` environment to install packages used for the action and +leave the `base` environment untouched, with only `conda` (or `mamba`) in it. + +### Use a different environment name + +You can change the default `test` environment to have a different name bu setting the +`activate-environment` input option. + +```yaml + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: whatever +``` + +### Activate `base` environment + +If your specific workflow still needs to activate and use `base` you will need to set the +`activate-environment` input option to an empty string and also the `auto-activate-base` +key to `true`. + +```yaml + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-activate-base: true + activate-environment: "" +``` + ## Usage examples For a full list of available inputs for this action see @@ -400,7 +429,7 @@ jobs: - Bash shells do not use `~/.profile` or `~/.bashrc` so these shells need to be explicitely declared as `shell: bash -l {0}` on steps that need to be properly - activated. This is because bash shells are executed with + activated (or use a default shell). This is because bash shells are executed with `bash --noprofile --norc -eo pipefail {0}` thus ignoring updated on bash profile files made by `conda init bash`. See [Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell) @@ -408,12 +437,12 @@ jobs: [thread](https://github.community/t5/GitHub-Actions/How-to-share-shell-profile-between-steps-or-how-to-use-nvm-rvm/td-p/33185). - Sh shells do not use `~/.profile` or `~/.bashrc` so these shells need to be explicitely declared as `shell: sh -l {0}` on steps that need to be properly - activated. This is because sh shells are executed with `sh -e {0}` thus + activated (or use a default shell). This is because sh shells are executed with `sh -e {0}` thus ignoring updated on bash profile files made by `conda init bash`. See [Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell). - Cmd shells do not run `Autorun` commands so these shells need to be explicitely declared as `shell: cmd /C call {0}` on steps that need to be - properly activated. This is because cmd shells are executed with + properly activated (or use a default shell). This is because cmd shells are executed with `%ComSpec% /D /E:ON /V:OFF /S /C "CALL "{0}""` and the `/D` flag disabled execution of `Command Processor/Autorun` windows registry keys, which is what `conda init cmd.exe` sets. See diff --git a/package-lock.json b/package-lock.json index b22efdb9..be1bc12b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5341,9 +5341,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, "init-package-json": {