From 44663f34dded2c771c18a9710676726414f7414c Mon Sep 17 00:00:00 2001 From: cbbm142 <50429657+cbbm142@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:33:56 -0400 Subject: [PATCH] Added ability to adjust priority to the mail message (#66) (#67) * Added ability to adjust priority to the mail message (#66) Co-authored-by: John Pastore Co-authored-by: Dawid Dziurla --- .github/workflows/test.yml | 1 + README.md | 2 ++ action.yml | 3 +++ main.js | 4 +++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c158cd72..50653ceb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,3 +55,4 @@ jobs: from: github-actions attachments: ${{matrix.attachments}} convert_markdown: ${{matrix.convert_markdown}} + priority: high diff --git a/README.md b/README.md index 25da9dfe..6f8f4e7f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 4448b2e7..bd9a09c8 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/main.js b/main.js index 44c44909..946294cd 100644 --- a/main.js +++ b/main.js @@ -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.") @@ -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)