From 54366f7399a620613eb43ec5e705ef2d7edcb16e Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Thu, 14 Dec 2023 17:36:25 +0100 Subject: [PATCH] . --- .github/workflows/test.yml | 3 ++- dist/index.js | 4 +++- dist/post.js | 4 +++- src/options.ts | 10 +++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df4f29a..01d5d74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -327,11 +327,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + # this should produce a warning - uses: ./ with: condarc-file: test/.condarc.2 - run: | - micromamba search pytorch + micromamba info shell: bash -elo pipefail {0} # not properly testable diff --git a/dist/index.js b/dist/index.js index 532a53e..4754d68 100644 --- a/dist/index.js +++ b/dist/index.js @@ -83525,7 +83525,9 @@ var checkForKnownIssues = (options2) => { "You are using a micromamba version < 1.4.5-0 and initialize the shell. This is behavior is deprecated. Please update the micromamba version. For further informations, see https://github.com/mamba-org/setup-micromamba/pull/107" ); } - if (options2.condarcFile && path.basename(options2.condarcFile) !== ".condarc") { + const condarcBasename = path.basename(options2.condarcFile); + const hasValidCondarcName = condarcBasename === ".condarc" || condarcBasename === "condarc" || condarcBasename === ".mambarc" || condarcBasename === "mambarc" || condarcBasename.endsWith(".yml") || condarcBasename.endsWith(".yaml"); + if (!hasValidCondarcName) { core2.warning( `You are using a condarc file that is not named '.condarc'. This is currently not supported by micromamba, see https://github.com/mamba-org/mamba/issues/1394` ); diff --git a/dist/post.js b/dist/post.js index ebdc768..9cbfc9b 100644 --- a/dist/post.js +++ b/dist/post.js @@ -78789,7 +78789,9 @@ var checkForKnownIssues = (options2) => { "You are using a micromamba version < 1.4.5-0 and initialize the shell. This is behavior is deprecated. Please update the micromamba version. For further informations, see https://github.com/mamba-org/setup-micromamba/pull/107" ); } - if (options2.condarcFile && path.basename(options2.condarcFile) !== ".condarc") { + const condarcBasename = path.basename(options2.condarcFile); + const hasValidCondarcName = condarcBasename === ".condarc" || condarcBasename === "condarc" || condarcBasename === ".mambarc" || condarcBasename === "mambarc" || condarcBasename.endsWith(".yml") || condarcBasename.endsWith(".yaml"); + if (!hasValidCondarcName) { core.warning( `You are using a condarc file that is not named '.condarc'. This is currently not supported by micromamba, see https://github.com/mamba-org/mamba/issues/1394` ); diff --git a/src/options.ts b/src/options.ts index 52e5651..3445a38 100644 --- a/src/options.ts +++ b/src/options.ts @@ -224,7 +224,15 @@ const checkForKnownIssues = (options: Options) => { 'You are using a micromamba version < 1.4.5-0 and initialize the shell. This is behavior is deprecated. Please update the micromamba version. For further informations, see https://github.com/mamba-org/setup-micromamba/pull/107' ) } - if (options.condarcFile && path.basename(options.condarcFile) !== '.condarc') { + const condarcBasename = path.basename(options.condarcFile) + const hasValidCondarcName = + condarcBasename === '.condarc' || + condarcBasename === 'condarc' || + condarcBasename === '.mambarc' || + condarcBasename === 'mambarc' || + condarcBasename.endsWith('.yml') || + condarcBasename.endsWith('.yaml') + if (!hasValidCondarcName) { core.warning( `You are using a condarc file that is not named '.condarc'. This is currently not supported by micromamba, see https://github.com/mamba-org/mamba/issues/1394` )