Skip to content

Commit

Permalink
Upgrade node 20 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sc979 authored Feb 12, 2024
1 parent 29d9f8a commit 616cfc1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
6 changes: 1 addition & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ inputs:
description: 'The number of days which the sandbox had no activity'
required: false
default: "0"
european-region:
description: 'For platforms using .eu'
required: false
default: "false"
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'

11 changes: 2 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4622,8 +4622,7 @@ try {
sandboxName: core.getInput('sandbox-name', { trimWhitespace: true }),
cleanAmount: Number.parseInt(core.getInput('clean-amount')),
deleteOnPromote: core.getBooleanInput('delete-on-promote') || false,
cleanModifiedBefore: parseInt(core.getInput('clean-modified-before', { trimWhitespace: true }) || '0'),
europeanRegion: core.getBooleanInput('european-region') || false
cleanModifiedBefore: parseInt(core.getInput('clean-modified-before', { trimWhitespace: true }) || '0')
};
if (o.activity !== 'clean' && o.sandboxName.length === 0) {
let message = `Need Sandbox name to execute action: ${o.activity}`;
Expand Down Expand Up @@ -4874,15 +4873,10 @@ exports.SandboxAPIProcessor = SandboxAPIProcessor;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.generateHeader = exports.getHost = void 0;
const crypto_1 = __nccwpck_require__(6417);
const core = __importStar(__nccwpck_require__(2186));
const preFix = "VERACODE-HMAC-SHA-256";
const verStr = "vcode_request_version_1";
const alg = 'sha256';
if (core.getBooleanInput('european-region') == true) {
const host = "api.veracode.eu";
} else {
const host = "api.veracode.com";
}
const host = "api.veracode.eu";
const hmac256 = (data, key, format) => {
var hash = (0, crypto_1.createHmac)(alg, key).update(data);
// no format = Buffer / byte array
Expand Down Expand Up @@ -4948,7 +4942,6 @@ function run(opt, msgFunc) {
const sandboxName = opt.sandboxName;
const amount = opt.cleanAmount;
const modifiedBefore = new Date();
const euRegion = opt.europeanRegion;
modifiedBefore.setDate(modifiedBefore.getDate() - opt.cleanModifiedBefore);
switch (action) {
case 'clean':
Expand Down
3 changes: 1 addition & 2 deletions src/Options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export interface Options {
sandboxName: string,
cleanAmount: number,
deleteOnPromote: boolean,
cleanModifiedBefore: number,
europeanRegion: boolean
cleanModifiedBefore: number
}
3 changes: 1 addition & 2 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ try {
sandboxName: core.getInput('sandbox-name',{trimWhitespace:true}),
cleanAmount: Number.parseInt(core.getInput('clean-amount')),
deleteOnPromote: core.getBooleanInput('delete-on-promote') || false,
cleanModifiedBefore: parseInt(core.getInput('clean-modified-before',{trimWhitespace:true}) || '0'),
europeanRegion: core.getBooleanInput('european-region') || false
cleanModifiedBefore: parseInt(core.getInput('clean-modified-before',{trimWhitespace:true}) || '0')
};

if (o.activity !== 'clean' && o.sandboxName.length===0) {
Expand Down
2 changes: 1 addition & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const preFix = "VERACODE-HMAC-SHA-256";
const verStr = "vcode_request_version_1";
const alg = 'sha256';

const host = "api.veracode.com";
const host = "api.veracode.eu";

const hmac256 = (data:BinaryLike, key: BinaryLike, format?: BinaryToTextEncoding ) => {
var hash = createHmac(alg, key).update(data);
Expand Down

0 comments on commit 616cfc1

Please sign in to comment.