Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make not specifying a required input a user error
  • Loading branch information
henrymercer committed Jul 28, 2023
commit 56912050775d4b1d9185ee30b8d63086741bd348
6 changes: 5 additions & 1 deletion lib/actions-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/actions-util.js.map

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

6 changes: 5 additions & 1 deletion src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const pkg = require("../package.json") as JSONSchemaForNPMPackageJsonFiles;
* This allows us to get stronger type checking of required/optional inputs.
*/
export const getRequiredInput = function (name: string): string {
return core.getInput(name, { required: true });
const value = core.getInput(name);
if (!value) {
throw new UserError(`Input required and not supplied: ${name}`);
}
return value;
};

/**
Expand Down