From d6bb4b0abc273c6d23f3712b62cfa5ff35435ec0 Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Fri, 13 May 2022 00:09:49 +0200 Subject: [PATCH] Fix #54 --- dist/main/index.js | 20 ++++++++++++-------- index.js | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index 3bc646dd..0eb17e02 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -275,6 +275,7 @@ channel_priority: strict } async function installEnvironment (inputs, envFilePath, envYaml) { + core.warning([envFilePath, inputs.extraSpecs]) if (!envFilePath && !inputs.extraSpecs) { // Nothing to install return @@ -282,13 +283,8 @@ async function installEnvironment (inputs, envFilePath, envYaml) { // Determine environment name let envName - if (inputs.envFile === 'false') { - if (inputs.envName) { - envName = inputs.envName - } else { - throw Error("Must provide 'environment-name' for 'environment-file: false'") - } - } else { + if (envFilePath) { + // Have environment.yml or .lock file if (envYaml) { if (inputs.envName) { envName = inputs.envName @@ -299,13 +295,21 @@ async function installEnvironment (inputs, envFilePath, envYaml) { throw Error("Must provide 'environment-name' if environment.yml doesn't provide a 'name' attribute") } } - } else { // .lock file + } else { + // .lock file if (inputs.envName) { envName = inputs.envName } else { throw Error("Must provide 'environment-name' for .lock files") } } + } else { + // Have extra-specs only + if (inputs.envName) { + envName = inputs.envName + } else { + throw Error("Must provide 'environment-name' for 'environment-file: false'") + } } // Install env diff --git a/index.js b/index.js index 98faf1fc..27b5906f 100644 --- a/index.js +++ b/index.js @@ -263,6 +263,7 @@ channel_priority: strict } async function installEnvironment (inputs, envFilePath, envYaml) { + core.warning([envFilePath, inputs.extraSpecs]) if (!envFilePath && !inputs.extraSpecs) { // Nothing to install return @@ -270,13 +271,8 @@ async function installEnvironment (inputs, envFilePath, envYaml) { // Determine environment name let envName - if (inputs.envFile === 'false') { - if (inputs.envName) { - envName = inputs.envName - } else { - throw Error("Must provide 'environment-name' for 'environment-file: false'") - } - } else { + if (envFilePath) { + // Have environment.yml or .lock file if (envYaml) { if (inputs.envName) { envName = inputs.envName @@ -287,13 +283,21 @@ async function installEnvironment (inputs, envFilePath, envYaml) { throw Error("Must provide 'environment-name' if environment.yml doesn't provide a 'name' attribute") } } - } else { // .lock file + } else { + // .lock file if (inputs.envName) { envName = inputs.envName } else { throw Error("Must provide 'environment-name' for .lock files") } } + } else { + // Have extra-specs only + if (inputs.envName) { + envName = inputs.envName + } else { + throw Error("Must provide 'environment-name' for 'environment-file: false'") + } } // Install env