8 Commits
v3.8.0 ... v3

Author SHA1 Message Date
4226df7daa Update to Node20 (#193) 2024-01-27 00:23:23 +01:00
97a10a20cc build(deps): bump @actions/core from 1.10.0 to 1.10.1 (#181)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.0 to 1.10.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

[ci skip]

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 09:09:27 +01:00
9767c2af4d build(deps): bump nodemailer from 6.9.1 to 6.9.8 (#191)
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.1 to 6.9.8.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.1...v6.9.8)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

[ci skip]

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 09:09:02 +01:00
d6910da162 README: GitHub
[ci skip]
2024-01-06 13:49:07 +01:00
dc13c734ff Enable logging and debug of nodemailer (#190)
This should help A LOT to let people understand
why things go wrong in this action when talking to the mailhost
2024-01-05 18:40:18 +01:00
48476814b0 Made "to" optional (incase cc or bcc is provided) (#183)
* Added made to optional (incase cc or bcc is provided)

* updated action.yml
2023-09-27 08:49:06 +02:00
e3f3ba4f86 build(deps): bump actions/checkout from 3 to 4 (#179)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:47:40 +02:00
19516a4a58 fix #176 by removing useless warning message (#177) 2023-08-19 08:57:30 +02:00
6 changed files with 41 additions and 26 deletions

View File

@ -42,7 +42,7 @@ jobs:
html_body: file://README.md
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Send mail
uses: ./
with:
@ -63,7 +63,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Send mail
uses: ./
with:

View File

@ -1,4 +1,4 @@
# Send mail Github Action
# Send mail GitHub Action
An action that simply sends a mail to multiple recipients.
@ -60,6 +60,10 @@ Some features:
attachments: attachments.zip,git.diff,./dist/static/*.js
# Optional priority: 'high', 'normal' (default) or 'low'
priority: low
# Optional nodemailerlog: true/false
nodemailerlog: false
# Optional nodemailerdebug: true/false if true lognodem will also be set true
nodemailerdebug: false
```
## Troubleshooting

View File

@ -23,7 +23,7 @@ inputs:
required: true
to:
description: Recipients mail addresses (separated with comma)
required: true
required: false
from:
description: Full name of mail sender (might be with an email address specified in <>)
required: true
@ -57,6 +57,12 @@ inputs:
priority:
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
required: false
nodemailerlog:
description: Log option for nodemailer
required: false
nodemailerdebug:
description: Debug option for nodemailer
required: false
runs:
using: node16
using: node20
main: main.js

15
main.js
View File

@ -80,7 +80,7 @@ async function main() {
const subject = core.getInput("subject", { required: true })
const from = core.getInput("from", { required: true })
const to = core.getInput("to", { required: true })
const to = core.getInput("to", { required: false })
const body = core.getInput("body", { required: false })
const htmlBody = core.getInput("html_body", { required: false })
const cc = core.getInput("cc", { required: false })
@ -91,15 +91,18 @@ async function main() {
const convertMarkdown = core.getInput("convert_markdown", { required: false })
const ignoreCert = core.getInput("ignore_cert", { required: false })
const priority = core.getInput("priority", { required: false })
const nodemailerlog = core.getInput("nodemailerlog", { required: false })
const nodemailerdebug = core.getInput("nodemailerdebug", { required: false })
// if neither to, cc or bcc is provided, throw error
if (!to && !cc && !bcc) {
throw new Error("At least one of 'to', 'cc' or 'bcc' must be specified")
}
if (!serverAddress) {
throw new Error("Server address must be specified")
}
if (!username || !password) {
core.warning("Username and password not specified. You should only do this if you are using a self-hosted runner to access an on-premise mail server.")
}
const transport = nodemailer.createTransport({
host: serverAddress,
auth: username && password ? {
@ -111,6 +114,8 @@ async function main() {
tls: ignoreCert == "true" ? {
rejectUnauthorized: false
} : undefined,
logger: nodemailerdebug == "true" ? true : nodemailerlog,
debug: nodemailerdebug,
})
const info = await transport.sendMail({

28
package-lock.json generated
View File

@ -6,16 +6,16 @@
"": {
"name": "action-send-mail",
"dependencies": {
"@actions/core": "^1.2.7",
"@actions/core": "^1.10.1",
"@actions/glob": "^0.4.0",
"nodemailer": "^6.9.1",
"nodemailer": "^6.9.8",
"showdown": "^1.9.1"
}
},
"node_modules/@actions/core": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
"dependencies": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
@ -171,9 +171,9 @@
}
},
"node_modules/nodemailer": {
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.1.tgz",
"integrity": "sha512-qHw7dOiU5UKNnQpXktdgQ1d3OFgRAekuvbJLcdG5dnEo/GtcTHRYM7+UfJARdOFU9WUQO8OiIamgWPmiSFHYAA==",
"version": "6.9.8",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.8.tgz",
"integrity": "sha512-cfrYUk16e67Ks051i4CntM9kshRYei1/o/Gi8K1d+R34OIs21xdFnW7Pt7EucmVKA0LKtqUGNcjMZ7ehjl49mQ==",
"engines": {
"node": ">=6.0.0"
}
@ -341,9 +341,9 @@
},
"dependencies": {
"@actions/core": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
"requires": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
@ -472,9 +472,9 @@
}
},
"nodemailer": {
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.1.tgz",
"integrity": "sha512-qHw7dOiU5UKNnQpXktdgQ1d3OFgRAekuvbJLcdG5dnEo/GtcTHRYM7+UfJARdOFU9WUQO8OiIamgWPmiSFHYAA=="
"version": "6.9.8",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.8.tgz",
"integrity": "sha512-cfrYUk16e67Ks051i4CntM9kshRYei1/o/Gi8K1d+R34OIs21xdFnW7Pt7EucmVKA0LKtqUGNcjMZ7ehjl49mQ=="
},
"p-limit": {
"version": "2.3.0",

View File

@ -2,9 +2,9 @@
"name": "action-send-mail",
"main": "main.js",
"dependencies": {
"@actions/core": "^1.2.7",
"@actions/core": "^1.10.1",
"@actions/glob": "^0.4.0",
"nodemailer": "^6.9.1",
"nodemailer": "^6.9.8",
"showdown": "^1.9.1"
}
}