Skip to content

Commit

Permalink
Support the upload verb if an existing file is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Reynolds committed Nov 7, 2024
1 parent 89d7ff2 commit c5bc432
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/msdo-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var Inputs;
Inputs["Languages"] = "languages";
Inputs["Tools"] = "tools";
Inputs["IncludeTools"] = "includeTools";
Inputs["ExistingFilename"] = "existingFilename";
})(Inputs || (exports.Inputs = Inputs = {}));
var RunnerType;
(function (RunnerType) {
Expand Down
9 changes: 8 additions & 1 deletion lib/msdo.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ class MicrosoftSecurityDevOps {
runMain() {
return __awaiter(this, void 0, void 0, function* () {
core.debug('MicrosoftSecurityDevOps.runMain - Running MSDO...');
let args = ['run'];
let args = undefined;
let existingFilename = core.getInput('existingFilename');
if (!common.isNullOrWhiteSpace(existingFilename)) {
args = ['upload', '--file', existingFilename];
}
else {
args = ['run'];
}
let config = core.getInput('config');
if (!common.isNullOrWhiteSpace(config)) {
args.push('-c');
Expand Down
3 changes: 2 additions & 1 deletion node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "microsoft-security-devops-action",
"version": "1.11.0",
"version": "1.12.0",
"description": "Node dependencies for the microsoft/security-devops-action.",
"scripts": {
"build": "npx gulp",
Expand Down
3 changes: 2 additions & 1 deletion src/msdo-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export enum Inputs {
Categories = 'categories',
Languages = 'languages',
Tools = 'tools',
IncludeTools = 'includeTools'
IncludeTools = 'includeTools',
ExistingFilename = 'existingFilename'
}

/**
Expand Down
10 changes: 9 additions & 1 deletion src/msdo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ export class MicrosoftSecurityDevOps implements IMicrosoftSecurityDevOps {

public async runMain() {
core.debug('MicrosoftSecurityDevOps.runMain - Running MSDO...');
let args: string[] = undefined;

let args: string[] = ['run'];
// Check job type - might be existing file
let existingFilename = core.getInput('existingFilename');
if (!common.isNullOrWhiteSpace(existingFilename)) {
args = ['upload', '--file', existingFilename];
}
else {
args = ['run'];
}

let config: string = core.getInput('config');
if (!common.isNullOrWhiteSpace(config)) {
Expand Down

0 comments on commit c5bc432

Please sign in to comment.