Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: implement silentFailure config and outputs.failure #106

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
build
  • Loading branch information
znarf committed Dec 12, 2019
commit bfd0d500eee5a628098cbca2b009a49264bf5b26
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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: ''
```
<!-- end usage -->
16 changes: 15 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -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;