-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (32 loc) · 1.26 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// entry point when called from a Workflow Action
//
const core = require('@actions/core');
const github = require('@actions/github');
const importFlaws = require('./importer').importFlaws;
console.log('WARNING');
console.log('WARNING: This Action has been deprecated.');
console.log('WARNING: Please switch to https://github.com/buzzcode/veracode-flaws-to-issues');
console.log('WARNING');
try {
// get input params
const resultsFile = core.getInput('pipeline-results-json', {required: true} );
const token = core.getInput('github-token', {required: true} );
const waitTime = core.getInput('wait-time'); // default set in Action.yml
// other params
const owner = github.context.repo.owner;
const repo = github.context.repo.repo;
// context {{ github.repository }} = 'owner/reponame'
//console.log(`Calling with: resultsFile: ${resultsFile}, token: ${token}, waitTime: ${waitTime}, owner: ${owner}, repo: ${repo}`)
// do the thing
importFlaws(
{resultsFile: resultsFile,
githubOwner: owner,
githubRepo: repo,
githubToken: token,
waitTime: waitTime}
)
.catch(error => {console.error(`Failure at ${error.stack}`)});
} catch (error) {
core.setFailed(error.stack);
}