Skip to content

Commit

Permalink
Exit immediatly when retention-days and compression-level are not…
Browse files Browse the repository at this point in the history
… numeric
  • Loading branch information
tangrufus committed Sep 27, 2024
1 parent a93ca8e commit 86547bc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 69 deletions.
100 changes: 33 additions & 67 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import { readFileSync } from 'fs';
import { exit } from 'process';
import { debug, getInput, setOutput, setFailed, startGroup, endGroup } from '@actions/core';
import { DefaultArtifactClient } from '@actions/artifact';

function getIntInput(key) {
const inputStr = getInput(key)
if (!inputStr) {
setFailed(`Invalid ${key}: Blank value`)
exit()
}
const inputInt = parseInt(inputStr)
if (isNaN(inputInt)) {
setFailed(`Invalid ${key}: Not a number`)
exit()
}
return inputInt
}

async function run() {
try {
startGroup('Do some function')
startGroup('Inputs')
const name = getInput('name');
debug(`Name: ${name}`);
const dist = getInput('dist');
Expand Down

0 comments on commit 86547bc

Please sign in to comment.