Skip to content

Commit

Permalink
Added ability to adjust priority to the mail message (#66) (#67)
Browse files Browse the repository at this point in the history
* Added ability to adjust priority to the mail message (#66)

Co-authored-by: John Pastore <cbbm142@github.com>
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
  • Loading branch information
3 people authored Jul 2, 2021
1 parent db36373 commit 44663f3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ jobs:
from: github-actions
attachments: ${{matrix.attachments}}
convert_markdown: ${{matrix.convert_markdown}}
priority: high
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Some features:
convert_markdown: true
# Optional attachments:
attachments: attachments.zip,git.diff,./dist/static/main.js
# Optional priority: 'high', 'normal' (default) or 'low'
priority: low
```
## Troubleshooting
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ inputs:
attachments:
description: Files that will be added to mail message attachments (separated with comma)
required: false
priority:
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
required: false
runs:
using: node12
main: main.js
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async function main() {
const attachments = core.getInput("attachments", { required: false })
const convertMarkdown = core.getInput("convert_markdown", { required: false })
const ignoreCert = core.getInput("ignore_cert", { required: false })
const priority = core.getInput("priority", { required: false })

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.")
Expand Down Expand Up @@ -74,7 +75,8 @@ async function main() {
replyTo: replyTo ? replyTo : undefined,
text: body ? getBody(body, false) : undefined,
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined,
priority: priority ? priority : undefined,
})
} catch (error) {
core.setFailed(error.message)
Expand Down

0 comments on commit 44663f3

Please sign in to comment.