Merge pull request #39 from dawidd6/ignore-cert

main: ignore cert if desired
This commit is contained in:
Dawid Dziurla 2021-04-02 00:04:33 +02:00 committed by GitHub
commit 0037ae15ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,8 @@ An action that simply sends a mail to multiple recipients.
cc: kyloren@example.com,leia@example.com cc: kyloren@example.com,leia@example.com
# Optional blind carbon copy recipients # Optional blind carbon copy recipients
bcc: r2d2@example.com,hansolo@example.com bcc: r2d2@example.com,hansolo@example.com
# Optional unsigned/invalid certificates allowance:
ignore_cert: true
# Optional content type (defaults to text/plain): # Optional content type (defaults to text/plain):
content_type: text/html content_type: text/html
# Optional converting Markdown to HTML (set content_type to text/html too): # Optional converting Markdown to HTML (set content_type to text/html too):

View File

@ -35,6 +35,9 @@ inputs:
bcc: bcc:
description: Blind carbon copy recipients (separated with comma) description: Blind carbon copy recipients (separated with comma)
required: false required: false
ignore_cert:
description: Allow unsigned/invalid certificates
required: false
content_type: content_type:
description: Content-Type HTTP header (text/html or text/plain) description: Content-Type HTTP header (text/html or text/plain)
required: false required: false

View File

@ -44,6 +44,7 @@ async function main() {
const contentType = core.getInput("content_type", { required: true }) const contentType = core.getInput("content_type", { required: true })
const attachments = core.getInput("attachments", { required: false }) const attachments = core.getInput("attachments", { required: false })
const convertMarkdown = core.getInput("convert_markdown", { required: false }) const convertMarkdown = core.getInput("convert_markdown", { required: false })
const ignoreCert = core.getInput("ignore_cert", { required: false })
const transport = nodemailer.createTransport({ const transport = nodemailer.createTransport({
host: serverAddress, host: serverAddress,
@ -53,6 +54,9 @@ async function main() {
user: username, user: username,
pass: password, pass: password,
} }
tls: ignoreCert ? {
rejectUnauthorized: false
} : undefined
}) })
const info = await transport.sendMail({ const info = await transport.sendMail({