Skip to content

Commit

Permalink
Fix env activation on win (a v3 regression) due to hard-coded install…
Browse files Browse the repository at this point in the history
… PATH (#325)

* Fix env activation on win (a v3 regression) due to hard-coded install PATH

* Prevent fork runs
  • Loading branch information
dbast authored Nov 29, 2023
1 parent c585a97 commit 8706aa7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/regression-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,33 @@ jobs:
- run: |
set -x
python -c "import sys; assert f'{sys.version_info.major}.{sys.version_info.minor}' == '${{ matrix.python-version }}'"
issue-324:
# prevent cronjobs from running on forks
if:
(github.event_name == 'schedule' && github.repository ==
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
runs-on: windows-latest
name: Issue 324
steps:
- uses: actions/checkout@v4
- uses: ./
with:
activate-environment: test-env
miniforge-version: latest
auto-update-conda: true
conda-solver: libmamba
- name: windows debug
shell: cmd /C CALL {0}
run: >-
conda info && conda list && set
- name: test for correct environment being activated
shell: cmd /C CALL {0}
run: >-
if "%CONDA_DEFAULT_ENV%" == "test-env" (
echo "test-env activated"
) else (
echo "test-env not activated"
exit 1
)
6 changes: 3 additions & 3 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47495,9 +47495,9 @@ function condaInit(inputs, options) {
}
else {
extraShells = {
"C:/Miniconda3/etc/profile.d/conda.sh": bashExtraText,
"C:/Miniconda3/etc/fish/conf.d/conda.fish": bashExtraText,
"C:/Miniconda3/condabin/conda_hook.bat": batchExtraText,
"~/miniconda3/etc/profile.d/conda.sh": bashExtraText,
"~/miniconda3/etc/fish/conf.d/conda.fish": bashExtraText,
"~/miniconda3/condabin/conda_hook.bat": batchExtraText,
};
}
const allShells = Object.assign(Object.assign({}, shells), extraShells);
Expand Down
6 changes: 3 additions & 3 deletions src/conda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ export async function condaInit(
};
} else {
extraShells = {
"C:/Miniconda3/etc/profile.d/conda.sh": bashExtraText,
"C:/Miniconda3/etc/fish/conf.d/conda.fish": bashExtraText,
"C:/Miniconda3/condabin/conda_hook.bat": batchExtraText,
"~/miniconda3/etc/profile.d/conda.sh": bashExtraText,
"~/miniconda3/etc/fish/conf.d/conda.fish": bashExtraText,
"~/miniconda3/condabin/conda_hook.bat": batchExtraText,
};
}
const allShells: types.IShells = { ...shells, ...extraShells };
Expand Down

0 comments on commit 8706aa7

Please sign in to comment.