Skip to content

Commit

Permalink
Add configure orientation for devcard
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdai committed Feb 20, 2024
1 parent 2ac7a29 commit 2b0992a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b0992a

Please sign in to comment.