Skip to content

Commit

Permalink
feat: enable artifact name input
Browse files Browse the repository at this point in the history
  • Loading branch information
camelmasa committed Aug 14, 2023
1 parent 42ff17e commit 2955266
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: 'Whether Github issues should be created or not'
required: false
default: true
artifact_name:
description: 'The name of the artifact that contains the ZAP reports'
required: false
default: 'zap_scan'
runs:
using: 'node16'
main: 'dist/index.js'
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async function run() {
let issueTitle = core.getInput('issue_title');
let failAction = core.getInput('fail_action');
let allowIssueWriting = core.getInput('allow_issue_writing');
let artifactName = core.getInput('artifact_name');
let createIssue = true;

if (!(String(failAction).toLowerCase() === 'true' || String(failAction).toLowerCase() === 'false')) {
Expand All @@ -31,6 +32,11 @@ async function run() {
createIssue = false;
}

if (!artifactName) {
console.log('[WARNING]: \'artifact_name\' action input should not be empty. Setting it back to the default name.');
artifactName = 'zap_scan';
}

console.log('starting the program');
console.log('github run id :' + currentRunnerID);

Expand Down Expand Up @@ -67,7 +73,7 @@ async function run() {
console.log('Scanning process completed, starting to analyze the results!')
}
}
await common.main.processReport(token, workspace, plugins, currentRunnerID, issueTitle, repoName, createIssue);
await common.main.processReport(token, workspace, plugins, currentRunnerID, issueTitle, repoName, createIssue, artifactName);
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 2955266

Please sign in to comment.