From bfd0d500eee5a628098cbca2b009a49264bf5b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franc=CC=A7ois=20Hodierne?= Date: Thu, 12 Dec 2019 15:34:50 +0100 Subject: [PATCH] build --- README.md | 4 ++++ dist/index.js | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76c4d77..1bf7fbd 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous # Whether to download Git-LFS files # Default: false lfs: '' + + # Whether to silent failure + # Default: false + silentFailure: '' ``` diff --git a/dist/index.js b/dist/index.js index 4a1027b..4b6be2b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2611,7 +2611,18 @@ function run() { // Register problem matcher coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json')); // Get sources - yield gitSourceProvider.getSource(sourceSettings); + try { + yield gitSourceProvider.getSource(sourceSettings); + } + catch (error) { + core.setOutput('failure', 'true'); + if (sourceSettings.silentFailure) { + core.info(`Silent Failure: ${error.message}`); + } + else { + throw error; + } + } } finally { // Unregister problem matcher @@ -10405,6 +10416,9 @@ function getInputs() { core.debug(`lfs = ${result.lfs}`); // Access token result.accessToken = core.getInput('token'); + // Silent Failure + result.silentFailure = + (core.getInput('silentFailure') || 'false').toUpperCase() === 'TRUE'; return result; } exports.getInputs = getInputs;