diff --git a/action.yml b/action.yml index 04d4c4a..38ed43a 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: required: true type: - description: "Configure orientation for devcard" + description: 'Configure orientation for devcard. Must be either "default" or "wide"' default: default required: false diff --git a/src/index.ts b/src/index.ts index ed4560e..45e1f98 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,6 +33,11 @@ const devcardURL = (user_id: string, type = 'default'): string => throw new Error('Filename is required') } + // throw an error if type is invalid, must be either "default" or "wide" + if (type && !['default', 'wide'].includes(type)) { + throw new Error('Invalid type. Must be either "default" or "wide"') + } + console.log(`Dryrun`, dryrun) // Fetch the latest devcard