diff --git a/dist/index.js b/dist/index.js index e91af65d..b1ad1812 100644 --- a/dist/index.js +++ b/dist/index.js @@ -50,7 +50,7 @@ async function run () { const envFileName = core.getInput('environment-file') const envFilePath = path.join(process.env.GITHUB_WORKSPACE || '', envFileName) const envYaml = yaml.safeLoad(fs.readFileSync(envFilePath, 'utf8')) - const envName = envYaml.name + const envName = core.getInput('environment-name') || envYaml.name const condarc = path.join(os.homedir(), '.condarc') const profile = path.join(os.homedir(), '.bash_profile') const bashrc = path.join(os.homedir(), '.bashrc') @@ -110,7 +110,7 @@ async function run () { // final bits of the install await execute('mkdir -p ' + path.join(os.homedir(), 'micromamba/pkgs/')) - await execute('source ' + profile + ' && micromamba create --strict-channel-priority -y -f ' + envFilePath) + await execute('source ' + profile + ' && micromamba create -n ' + envName + ' --strict-channel-priority -y -f ' + envFilePath) fs.appendFileSync(profile, 'set -eo pipefail\n') fs.appendFileSync(profile, 'micromamba activate ' + envName + '\n') core.endGroup() @@ -141,7 +141,7 @@ else // Can only init once right now ... // await execPwsh(".\\micromamba.exe shell init -s bash -p $HOME\\micromamba") await execPwsh('MD $HOME\\micromamba\\pkgs -ea 0') - await execPwsh(`.\\micromamba.exe create --strict-channel-priority -y -f ${envFilePath}`) + await execPwsh(`.\\micromamba.exe create -n ` + envName + ` --strict-channel-priority -y -f ${envFilePath}`) await execPwsh(autoactivate) fs.appendFileSync(profile, `micromamba activate ${envName}\n`)