mirror of
https://github.com/peter-evans/create-or-update-comment.git
synced 2025-04-20 03:26:43 +08:00
* 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
21 lines
463 B
TypeScript
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)
|
|
}
|