From 83f4f82909c8b77768fb3a76e22aee129531e8c0 Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Wed, 19 Feb 2020 20:45:01 +0100 Subject: [PATCH] Don't show versioninfo() by default (#25) * Only show versioninfo() in debug mode * Add input to specify if versioninfo() is displayed * No access to secrets --- action.yml | 4 ++++ lib/setup-julia.js | 8 ++++++-- src/setup-julia.ts | 9 +++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 37fe45d..d50fe74 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,10 @@ inputs: description: 'Architecture of the Julia binaries. Defaults to x64.' required: false default: 'x64' + show-versioninfo: + description: 'Display InteractiveUtils.versioninfo() after installing' + required: false + default: 'false' runs: using: 'node12' main: 'lib/setup-julia.js' diff --git a/lib/setup-julia.js b/lib/setup-julia.js index c7b8a62..25781d1 100644 --- a/lib/setup-julia.js +++ b/lib/setup-julia.js @@ -43,8 +43,12 @@ function run() { } // Add it to PATH core.addPath(path.join(juliaPath, 'bin')); - // Test if Julia has been installed by showing versioninfo() - yield exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']); + // Test if Julia has been installed + exec.exec('julia', ['--version']); + // If enabled, also show the full version info + if (core.getInput('show-versioninfo') == 'true') { + exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']); + } } catch (error) { core.setFailed(error.message); diff --git a/src/setup-julia.ts b/src/setup-julia.ts index 028ed68..4dd38e9 100644 --- a/src/setup-julia.ts +++ b/src/setup-julia.ts @@ -32,8 +32,13 @@ async function run() { // Add it to PATH core.addPath(path.join(juliaPath, 'bin')) - // Test if Julia has been installed by showing versioninfo() - await exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']) + // Test if Julia has been installed + exec.exec('julia', ['--version']) + + // If enabled, also show the full version info + if (core.getInput('show-versioninfo') == 'true') { + exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']) + } } catch (error) { core.setFailed(error.message) }