Peter Evans 3383acd359
v3 (#161)
* typescript

* fix reactions input

* test comma separated

* bump version

* append-separator

* refactor

* refactor reactions

* get reactions

* handle default token

* return reaction id

* remove reactions

* reactions-edit-mode

* readme

* test-command

* fix step order

* deprecate body-file

* update ci to body-path
2023-04-05 16:14:13 +09:00

21 lines
463 B
TypeScript

import * as core from '@actions/core'
export function getInputAsArray(
name: string,
options?: core.InputOptions
): string[] {
return getStringAsArray(core.getInput(name, options))
}
export function getStringAsArray(str: string): string[] {
return str
.split(/[\n,]+/)
.map(s => s.trim())
.filter(x => x !== '')
}
export function getErrorMessage(error: unknown) {
if (error instanceof Error) return error.message
return String(error)
}