mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-12-25 18:43:08 +07:00
main: fix attachments
This commit is contained in:
parent
8d8aef4e43
commit
68e6c95e79
4
main.js
4
main.js
@ -33,7 +33,7 @@ function getFrom(from, username) {
|
|||||||
async function getAttachments(attachments) {
|
async function getAttachments(attachments) {
|
||||||
const globber = await glob.create(attachments.split(',').join('\n'))
|
const globber = await glob.create(attachments.split(',').join('\n'))
|
||||||
const files = await globber.glob()
|
const files = await globber.glob()
|
||||||
return files.map(f => ({ path: f }))
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
@ -83,7 +83,7 @@ async function main() {
|
|||||||
text: body ? getBody(body, false) : undefined,
|
text: body ? getBody(body, false) : undefined,
|
||||||
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
|
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
|
||||||
priority: priority ? priority : undefined,
|
priority: priority ? priority : undefined,
|
||||||
attachments: attachments ? getAttachments(attachments) : undefined,
|
attachments: attachments ? (await getAttachments(attachments)) : undefined,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user