Skip to content

Commit 5691205

Browse files
committed
Make not specifying a required input a user error
1 parent 81ae676 commit 5691205

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/actions-util.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions-util.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ const pkg = require("../package.json") as JSONSchemaForNPMPackageJsonFiles;
2424
* This allows us to get stronger type checking of required/optional inputs.
2525
*/
2626
export const getRequiredInput = function (name: string): string {
27-
return core.getInput(name, { required: true });
27+
const value = core.getInput(name);
28+
if (!value) {
29+
throw new UserError(`Input required and not supplied: ${name}`);
30+
}
31+
return value;
2832
};
2933

3034
/**

0 commit comments

Comments
 (0)