Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'main' into support-remote-config
Sam Partington committed Jun 26, 2020

Unverified

No user is associated with the committer email.
2 parents 0607771 + 504c8cf commit ee4cc86
Showing 6 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/util.js

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

2 changes: 1 addition & 1 deletion lib/util.js.map

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

10 changes: 6 additions & 4 deletions lib/util.test.js
2 changes: 1 addition & 1 deletion lib/util.test.js.map
11 changes: 7 additions & 4 deletions src/util.test.ts
@@ -59,8 +59,11 @@ test('getThreadsFlag() should return the correct --threads flag', t => {
});

test('getThreadsFlag() throws if the ram input is < 0 or NaN', t => {
for (const input of ["hello!"]) {
process.env['INPUT_THREADS'] = input;
t.throws(util.getThreadsFlag);
}
process.env['INPUT_THREADS'] = "hello!";
t.throws(util.getThreadsFlag);
});

test('getRef() throws on the empty string', t => {
process.env["GITHUB_REF"] = "";
t.throws(util.getRef);
});
2 changes: 1 addition & 1 deletion src/util.ts
@@ -37,7 +37,7 @@ export function should_abort(actionName: string, requireInitActionHasRun: boolea
*/
export function getRequiredEnvParam(paramName: string): string {
const value = process.env[paramName];
if (value === undefined) {
if (value === undefined || value.length === 0) {
throw new Error(paramName + ' environment variable must be set');
}
core.debug(paramName + '=' + value);

0 comments on commit ee4cc86

Please sign in to comment.