main: fix attachments

This commit is contained in:
Dawid Dziurla 2021-07-13 18:30:04 +02:00
parent 8d8aef4e43
commit 68e6c95e79
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B

View File

@ -33,7 +33,7 @@ function getFrom(from, username) {
async function getAttachments(attachments) {
const globber = await glob.create(attachments.split(',').join('\n'))
const files = await globber.glob()
return files.map(f => ({ path: f }))
return files
}
async function main() {
@ -83,7 +83,7 @@ async function main() {
text: body ? getBody(body, false) : undefined,
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
priority: priority ? priority : undefined,
attachments: attachments ? getAttachments(attachments) : undefined,
attachments: attachments ? (await getAttachments(attachments)) : undefined,
})
} catch (error) {
core.setFailed(error.message)