add warning if go-version is empty

This commit is contained in:
Dmitry Shibanov 2023-03-08 13:31:51 +01:00
parent 7406d654ad
commit c7f2c70396
2 changed files with 7 additions and 0 deletions

3
dist/setup/index.js vendored
View file

@ -63600,6 +63600,9 @@ function run() {
core.debug(`add bin ${added}`); core.debug(`add bin ${added}`);
core.info(`Successfully set up Go version ${versionSpec}`); core.info(`Successfully set up Go version ${versionSpec}`);
} }
else {
core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.');
}
const goPath = yield io.which('go'); const goPath = yield io.which('go');
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString(); const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
if (cache && cache_utils_1.isCacheFeatureAvailable()) { if (cache && cache_utils_1.isCacheFeatureAvailable()) {

View file

@ -54,6 +54,10 @@ export async function run() {
const added = await addBinToPath(); const added = await addBinToPath();
core.debug(`add bin ${added}`); core.debug(`add bin ${added}`);
core.info(`Successfully set up Go version ${versionSpec}`); core.info(`Successfully set up Go version ${versionSpec}`);
} else {
core.info(
'[warning]go-version input was not specified. The action will try to use pre-installed version.'
);
} }
const goPath = await io.which('go'); const goPath = await io.which('go');