Make custom secure ports available (#51)

This commit is contained in:
a08381 2021-05-04 00:02:47 +08:00 committed by GitHub
parent 938c7ffae5
commit 98b61f505d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,8 @@ Some features:
to: obiwan@example.com,yoda@example.com to: obiwan@example.com,yoda@example.com
# Required sender full name (address can be skipped): # Required sender full name (address can be skipped):
from: Luke Skywalker # <user@example.com> from: Luke Skywalker # <user@example.com>
# Optional whether this connection use TLS (default is true if server_port is 465)
secure: true
# Optional plain body: # Optional plain body:
body: Build job of ${{github.repository}} completed successfully! body: Build job of ${{github.repository}} completed successfully!
# Optional HTML body read from file: # Optional HTML body read from file:

View File

@ -26,6 +26,9 @@ inputs:
from: from:
description: Full name of mail sender (might be with an email address specified in <>) description: Full name of mail sender (might be with an email address specified in <>)
required: true required: true
secure:
description: Whether this connection use TLS (default is true if server_port is 465)
required: false
body: body:
description: Body of mail message (might be a filename prefixed with file:// to read from) description: Body of mail message (might be a filename prefixed with file:// to read from)
required: false required: false

View File

@ -38,6 +38,7 @@ async function main() {
const subject = core.getInput("subject", { required: true }) const subject = core.getInput("subject", { required: true })
const from = core.getInput("from", { required: true }) const from = core.getInput("from", { required: true })
const to = core.getInput("to", { required: true }) const to = core.getInput("to", { required: true })
const secure = core.getInput("secure", { required: false })
const body = core.getInput("body", { required: false }) const body = core.getInput("body", { required: false })
const htmlBody = core.getInput("html_body", { required: false }) const htmlBody = core.getInput("html_body", { required: false })
const cc = core.getInput("cc", { required: false }) const cc = core.getInput("cc", { required: false })
@ -50,7 +51,7 @@ async function main() {
const transport = nodemailer.createTransport({ const transport = nodemailer.createTransport({
host: serverAddress, host: serverAddress,
port: serverPort, port: serverPort,
secure: serverPort == "465", secure: secure ? true : serverPort == "465",
auth: { auth: {
user: username, user: username,
pass: password, pass: password,