26 Commits

Author SHA1 Message Date
d1b07d9ed7 node_modules: update 2020-11-12 16:31:20 +01:00
345c86e5c4 package: update nodemailer 2020-11-12 16:31:13 +01:00
6fd4a30225 node_modules: update 2020-11-12 16:30:46 +01:00
2b66ab09bf Merge pull request #24 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.15
build(deps): bump nodemailer from 6.4.14 to 6.4.15
2020-11-12 16:29:13 +01:00
2faeb721e3 build(deps): bump nodemailer from 6.4.14 to 6.4.15
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.14 to 6.4.15.
- [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.4.14...v6.4.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 05:05:58 +00:00
9f0c00957b Merge pull request #22 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.14
build(deps): bump nodemailer from 6.4.13 to 6.4.14
2020-10-15 09:31:03 +02:00
1a06e16e55 build(deps): bump nodemailer from 6.4.13 to 6.4.14
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.13 to 6.4.14.
- [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.4.13...v6.4.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-15 02:39:14 +00:00
3a0e152e9d Merge pull request #21 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.13
build(deps): bump nodemailer from 6.4.12 to 6.4.13
2020-10-03 10:46:45 +02:00
c63d34f5ad build(deps): bump nodemailer from 6.4.12 to 6.4.13
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.12 to 6.4.13.
- [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.4.12...v6.4.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-03 00:12:32 +00:00
a80d851dc9 Merge pull request #19 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.12
build(deps): bump nodemailer from 6.4.11 to 6.4.12
2020-10-01 10:23:59 +02:00
37c6a4d431 build(deps): bump nodemailer from 6.4.11 to 6.4.12
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.11 to 6.4.12.
- [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.4.11...v6.4.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-01 00:26:37 +00:00
edca34ffa5 main: log only transport options 2020-09-24 10:27:30 +02:00
4effcb0f30 main: log transport 2020-09-24 10:24:29 +02:00
72d529bf7f Merge pull request #18 from dawidd6/dependabot-npm_and_yarn-actions-core-1.2.6
build(deps): bump @actions/core from 1.2.5 to 1.2.6
2020-09-24 10:13:01 +02:00
bd1a6a6dc3 build(deps): bump @actions/core from 1.2.5 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-23 23:54:17 +00:00
8e479bcc5d node_modules: update 2020-08-30 12:08:22 +02:00
e8b7af2f44 workflows: fix 2020-07-20 07:31:58 +02:00
55c338812f workflows: test text/markdown 2020-07-20 07:29:26 +02:00
73116f5945 node_modules: update 2020-07-09 15:48:05 +02:00
80f113f0ef Merge pull request #9 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.10
build(deps): bump nodemailer from 6.4.8 to 6.4.10
2020-06-18 07:19:08 +02:00
803b308fa9 build(deps): bump nodemailer from 6.4.8 to 6.4.10
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.8 to 6.4.10.
- [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.4.8...v6.4.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-18 05:03:53 +00:00
586960b884 Merge pull request #8 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.8
build(deps): bump nodemailer from 6.4.6 to 6.4.8
2020-05-29 07:41:08 +02:00
cb3cb8c8be build(deps): bump nodemailer from 6.4.6 to 6.4.8
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.6 to 6.4.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.4.6...v6.4.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-29 05:07:13 +00:00
172f2c9319 Merge pull request #7 from dawidd6/dependabot-npm_and_yarn-actions-core-1.2.4
build(deps): bump @actions/core from 1.2.3 to 1.2.4
2020-05-01 08:52:45 +02:00
611d60b8b4 build(deps): bump @actions/core from 1.2.3 to 1.2.4
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/master/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-01 05:04:19 +00:00
2f8c1bc14a workflows: trigger only on pushes to master 2020-04-07 10:42:30 +02:00
42 changed files with 451 additions and 231 deletions

View File

@ -1,6 +1,9 @@
name: Test action
on: push
on:
push:
branches:
- master
jobs:
main:
@ -8,11 +11,8 @@ jobs:
strategy:
max-parallel: 1
matrix:
content_type:
- text/plain
- text/html
include:
- content_type: text/plain
- content_type: text/markdown
body: file://README.md
attachments: action.yml
- content_type: text/html
@ -27,7 +27,7 @@ jobs:
attachments: package.json,package-lock.json
steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Send mail
uses: ./
with:

12
main.js
View File

@ -2,7 +2,7 @@ const nodemailer = require("nodemailer")
const core = require("@actions/core")
const fs = require("fs")
function get_body(body) {
function getBody(body) {
if (body.startsWith("file://")) {
const file = body.replace("file://", "")
return fs.readFileSync(file, "utf8")
@ -11,7 +11,7 @@ function get_body(body) {
return body
}
function get_from(from, username) {
function getFrom(from, username) {
if (from.match(/.+<.+@.+>/)) {
return from
}
@ -42,12 +42,14 @@ async function main() {
}
})
console.log(transport.options)
const info = await transport.sendMail({
from: get_from(from, username),
from: getFrom(from, username),
to: to,
subject: subject,
text: content_type != "text/html" ? get_body(body) : undefined,
html: content_type == "text/html" ? get_body(body) : undefined,
text: content_type != "text/html" ? getBody(body) : undefined,
html: content_type == "text/html" ? getBody(body) : undefined,
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined
})

9
node_modules/@actions/core/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -89,6 +89,7 @@ try {
}
// Do stuff
core.info('Output to the actions build log')
}
catch (err) {
core.error(`Error ${err}, action may still succeed though`);
@ -143,4 +144,4 @@ const core = require('@actions/core');
var pid = core.getState("pidToKill");
process.kill(pid);
```
```

View File

@ -1,5 +1,5 @@
interface CommandProperties {
[key: string]: string;
[key: string]: any;
}
/**
* Commands
@ -11,6 +11,6 @@ interface CommandProperties {
* ::warning::This is the message
* ::set-env name=MY_VAR::some value
*/
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
export declare function issue(name: string, message?: string): void;
export {};

View File

@ -8,6 +8,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(require("os"));
const utils_1 = require("./utils");
/**
* Commands
*
@ -62,13 +63,13 @@ class Command {
}
}
function escapeData(s) {
return (s || '')
return utils_1.toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
return (s || '')
return utils_1.toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')

View File

@ -1 +1 @@
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,C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AA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}

View File

@ -21,9 +21,9 @@ export declare enum ExitCode {
/**
* Sets env variable for this action and future actions in the job
* @param name the name of the variable to set
* @param val the value of the variable
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
*/
export declare function exportVariable(name: string, val: string): void;
export declare function exportVariable(name: string, val: any): void;
/**
* Registers a secret which will get masked from logs
* @param secret value of the secret
@ -46,15 +46,21 @@ export declare function getInput(name: string, options?: InputOptions): string;
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
export declare function setOutput(name: string, value: string): void;
export declare function setOutput(name: string, value: any): void;
/**
* Enables or disables the echoing of commands into stdout for the rest of the step.
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
*
*/
export declare function setCommandEcho(enabled: boolean): void;
/**
* Sets the action status to failed.
* When the action exits it will be with an exit code of 1
* @param message add error issue message
*/
export declare function setFailed(message: string): void;
export declare function setFailed(message: string | Error): void;
/**
* Gets whether Actions Step Debug is on or not
*/
@ -66,14 +72,14 @@ export declare function isDebug(): boolean;
export declare function debug(message: string): void;
/**
* Adds an error issue
* @param message error issue message
* @param message error issue message. Errors will be converted to string via toString()
*/
export declare function error(message: string): void;
export declare function error(message: string | Error): void;
/**
* Adds an warning issue
* @param message warning issue message
* @param message warning issue message. Errors will be converted to string via toString()
*/
export declare function warning(message: string): void;
export declare function warning(message: string | Error): void;
/**
* Writes info to log with console.log.
* @param message info message
@ -104,9 +110,9 @@ export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>
* Saves state for current action, the state can only be retrieved by this action's post job execution.
*
* @param name name of the state to store
* @param value value to store
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
export declare function saveState(name: string, value: string): void;
export declare function saveState(name: string, value: any): void;
/**
* Gets the value of an state set by this action's main execution.
*

View File

@ -17,6 +17,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("./command");
const file_command_1 = require("./file-command");
const utils_1 = require("./utils");
const os = __importStar(require("os"));
const path = __importStar(require("path"));
/**
@ -39,11 +41,21 @@ var ExitCode;
/**
* Sets env variable for this action and future actions in the job
* @param name the name of the variable to set
* @param val the value of the variable
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) {
process.env[name] = val;
command_1.issueCommand('set-env', { name }, val);
const convertedVal = utils_1.toCommandValue(val);
process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal);
}
}
exports.exportVariable = exportVariable;
/**
@ -59,7 +71,13 @@ exports.setSecret = setSecret;
* @param inputPath
*/
function addPath(inputPath) {
command_1.issueCommand('add-path', {}, inputPath);
const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
@ -82,12 +100,22 @@ exports.getInput = getInput;
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) {
command_1.issueCommand('set-output', { name }, value);
}
exports.setOutput = setOutput;
/**
* Enables or disables the echoing of commands into stdout for the rest of the step.
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
*
*/
function setCommandEcho(enabled) {
command_1.issue('echo', enabled ? 'on' : 'off');
}
exports.setCommandEcho = setCommandEcho;
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
@ -121,18 +149,18 @@ function debug(message) {
exports.debug = debug;
/**
* Adds an error issue
* @param message error issue message
* @param message error issue message. Errors will be converted to string via toString()
*/
function error(message) {
command_1.issue('error', message);
command_1.issue('error', message instanceof Error ? message.toString() : message);
}
exports.error = error;
/**
* Adds an warning issue
* @param message warning issue message
* @param message warning issue message. Errors will be converted to string via toString()
*/
function warning(message) {
command_1.issue('warning', message);
command_1.issue('warning', message instanceof Error ? message.toString() : message);
}
exports.warning = warning;
/**
@ -190,8 +218,9 @@ exports.group = group;
* Saves state for current action, the state can only be retrieved by this action's post job execution.
*
* @param name name of the state to store
* @param value value to store
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function saveState(name, value) {
command_1.issueCommand('save-state', { name }, value);
}

View File

@ -1 +1 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAE7C,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG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AC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}

1
node_modules/@actions/core/lib/file-command.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function issueCommand(command: string, message: any): void;

29
node_modules/@actions/core/lib/file-command.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
"use strict";
// For internal use, subject to change.
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(require("fs"));
const os = __importStar(require("os"));
const utils_1 = require("./utils");
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map

1
node_modules/@actions/core/lib/file-command.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,YAAY,CAAC,OAAe,EAAE,OAAY;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,oCAcC"}

5
node_modules/@actions/core/lib/utils.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
export declare function toCommandValue(input: any): string;

19
node_modules/@actions/core/lib/utils.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map

1
node_modules/@actions/core/lib/utils.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;AAEvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC"}

View File

@ -1,34 +1,36 @@
{
"_from": "@actions/core@1.2.3",
"_id": "@actions/core@1.2.3",
"_args": [
[
"@actions/core@1.2.6",
"/home/dawidd6/github/dawidd6/action-send-mail"
]
],
"_from": "@actions/core@1.2.6",
"_id": "@actions/core@1.2.6",
"_inBundle": false,
"_integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w==",
"_integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==",
"_location": "/@actions/core",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/core@1.2.3",
"raw": "@actions/core@1.2.6",
"name": "@actions/core",
"escapedName": "@actions%2fcore",
"scope": "@actions",
"rawSpec": "1.2.3",
"rawSpec": "1.2.6",
"saveSpec": null,
"fetchSpec": "1.2.3"
"fetchSpec": "1.2.6"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz",
"_shasum": "e844b4fa0820e206075445079130868f95bfca95",
"_spec": "@actions/core@1.2.3",
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"_spec": "1.2.6",
"_where": "/home/dawidd6/github/dawidd6/action-send-mail",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Actions core lib",
"devDependencies": {
"@types/node": "^12.0.2"
@ -38,9 +40,10 @@
"test": "__tests__"
},
"files": [
"lib"
"lib",
"!.DS_Store"
],
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
"homepage": "https://github.com/actions/toolkit/tree/main/packages/core",
"keywords": [
"github",
"actions",
@ -58,10 +61,10 @@
"directory": "packages/core"
},
"scripts": {
"audit-moderate": "npm install && npm audit --audit-level=moderate",
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"types": "lib/core.d.ts",
"version": "1.2.3"
"version": "1.2.6"
}

View File

@ -1,5 +1,8 @@
module.exports = {
printWidth: 160,
tabWidth: 4,
singleQuote: true
singleQuote: true,
endOfLine: 'lf',
trailingComma: 'none',
arrowParens: 'avoid'
};

34
node_modules/nodemailer/CHANGELOG.md generated vendored
View File

@ -1,5 +1,39 @@
# CHANGELOG
## 6.4.16 2020-11-12
- Applied updated prettier formating rules
## 6.4.15 2020-11-06
- Minor changes in header key casing
## 6.4.14 2020-10-14
- Disabled postinstall script
## 6.4.13 2020-10-02
- Fix normalizeHeaderKey method for single node messages
## 6.4.12 2020-09-30
- Better handling of attachment filenames that include quote symbols
- Includes all information from the oath2 error response in the error message (Normal Gaussian) [1787f227]
## 6.4.11 2020-07-29
- Fixed escape sequence handling in address parsing
## 6.4.10 2020-06-17
- Fixed RFC822 output for MailComposer when using invalid content-type value. Mostly relevant if message attachments have stragne content-type values set.
## 6.4.7 2020-05-28
- Always set charset=utf-8 for Content-Type headers
- Catch error whn using invalid crypto.sign input
## 6.4.6 2020-03-20
- fix: `requeueAttempts=n` should requeue `n` times (Patrick Malouin) [a27ed2f7]

76
node_modules/nodemailer/CODE_OF_CONDUCT.md generated vendored Normal file
View File

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at info@nodemailer.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@ -73,7 +73,7 @@ function _handleAddress(tokens) {
}
}
let _regexHandler = function(address) {
let _regexHandler = function (address) {
if (!data.address.length) {
data.address = [address.trim()];
return ' ';
@ -195,9 +195,9 @@ class Tokenizer {
* @param {String} chr Character from the address field
*/
checkChar(chr) {
if ((chr in this.operators || chr === '\\') && this.escaped) {
this.escaped = false;
} else if (this.operatorExpecting && chr === this.operatorExpecting) {
if (this.escaped) {
// ignore next condition blocks
} else if (chr === this.operatorExpecting) {
this.node = {
type: 'operator',
value: chr
@ -217,9 +217,7 @@ class Tokenizer {
this.operatorExpecting = this.operators[chr];
this.escaped = false;
return;
}
if (!this.escaped && chr === '\\') {
} else if (['"', "'"].includes(this.operatorExpecting) && chr === '\\') {
this.escaped = true;
return;
}
@ -232,11 +230,17 @@ class Tokenizer {
this.list.push(this.node);
}
if (this.escaped && chr !== '\\') {
this.node.value += '\\';
if (chr === '\n') {
// Convert newlines to spaces. Carriage return is ignored as \r and \n usually
// go together anyway and there already is a WS for \n. Lone \r means something is fishy.
chr = ' ';
}
if (chr.charCodeAt(0) >= 0x21 || [' ', '\t'].includes(chr)) {
// skip command bytes
this.node.value += chr;
}
this.node.value += chr;
this.escaped = false;
}
}

View File

@ -146,10 +146,7 @@ class MessageParser extends Transform {
return lines
.filter(line => line.trim())
.map(line => ({
key: line
.substr(0, line.indexOf(':'))
.trim()
.toLowerCase(),
key: line.substr(0, line.indexOf(':')).trim().toLowerCase(),
line
}));
}

View File

@ -110,10 +110,7 @@ class Cookies {
.split(';')
.forEach(cookiePart => {
let valueParts = cookiePart.split('=');
let key = valueParts
.shift()
.trim()
.toLowerCase();
let key = valueParts.shift().trim().toLowerCase();
let value = valueParts.join('=').trim();
let domain;

View File

@ -10,7 +10,7 @@ const packageData = require('../../package.json');
const MAX_REDIRECTS = 5;
module.exports = function(url, options) {
module.exports = function (url, options) {
return fetch(url, options);
};
@ -33,11 +33,7 @@ function fetch(url, options) {
let fetchRes = options.fetchRes;
let parsed = urllib.parse(url);
let method =
(options.method || '')
.toString()
.trim()
.toUpperCase() || 'GET';
let method = (options.method || '').toString().trim().toUpperCase() || 'GET';
let finished = false;
let cookies;
let body;
@ -115,11 +111,7 @@ function fetch(url, options) {
headers['Content-Length'] = body.length;
}
// if method is not provided, use POST instead of GET
method =
(options.method || '')
.toString()
.trim()
.toUpperCase() || 'POST';
method = (options.method || '').toString().trim().toUpperCase() || 'POST';
}
let req;

View File

@ -100,12 +100,7 @@ class MailComposer {
if (attachment.filename) {
data.filename = attachment.filename;
} else if (!isMessageNode && attachment.filename !== false) {
data.filename =
(attachment.path || attachment.href || '')
.split('/')
.pop()
.split('?')
.shift() || 'attachment-' + (i + 1);
data.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);
if (data.filename.indexOf('.') < 0) {
data.filename += '.' + mimeFuncs.detectExtension(data.contentType);
}
@ -207,7 +202,7 @@ class MailComposer {
content: this.mail.text
};
}
text.contentType = 'text/plain' + (!text.encoding && mimeFuncs.isPlainText(text.content) ? '' : '; charset=utf-8');
text.contentType = 'text/plain; charset=utf-8';
}
if (this.mail.watchHtml) {
@ -221,7 +216,7 @@ class MailComposer {
content: this.mail.watchHtml
};
}
watchHtml.contentType = 'text/watch-html' + (!watchHtml.encoding && mimeFuncs.isPlainText(watchHtml.content) ? '' : '; charset=utf-8');
watchHtml.contentType = 'text/watch-html; charset=utf-8';
}
if (this.mail.amp) {
@ -232,7 +227,7 @@ class MailComposer {
content: this.mail.amp
};
}
amp.contentType = 'text/x-amp-html' + (!amp.encoding && mimeFuncs.isPlainText(amp.content) ? '' : '; charset=utf-8');
amp.contentType = 'text/x-amp-html; charset=utf-8';
}
// only include the calendar alternative if there are no attachments
@ -261,12 +256,7 @@ class MailComposer {
}
eventObject.filename = false;
eventObject.contentType =
'text/calendar; charset="utf-8"; method=' +
(eventObject.method || 'PUBLISH')
.toString()
.trim()
.toUpperCase();
eventObject.contentType = 'text/calendar; charset=utf-8; method=' + (eventObject.method || 'PUBLISH').toString().trim().toUpperCase();
if (!eventObject.headers) {
eventObject.headers = {};
}
@ -280,7 +270,7 @@ class MailComposer {
content: this.mail.html
};
}
html.contentType = 'text/html' + (!html.encoding && mimeFuncs.isPlainText(html.content) ? '' : '; charset=utf-8');
html.contentType = 'text/html; charset=utf-8';
}
[]
@ -480,7 +470,8 @@ class MailComposer {
textEncoding: this.mail.textEncoding,
boundaryPrefix: this.mail.boundaryPrefix,
disableUrlAccess: this.mail.disableUrlAccess,
disableFileAccess: this.mail.disableFileAccess
disableFileAccess: this.mail.disableFileAccess,
normalizeHeaderKey: this.mail.normalizeHeaderKey
});
} else {
node = parentNode.createChild(element.contentType, {

View File

@ -64,12 +64,7 @@ class MailMessage {
if (this.data.attachments && this.data.attachments.length) {
this.data.attachments.forEach((attachment, i) => {
if (!attachment.filename) {
attachment.filename =
(attachment.path || attachment.href || '')
.split('/')
.pop()
.split('?')
.shift() || 'attachment-' + (i + 1);
attachment.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);
if (attachment.filename.indexOf('.') < 0) {
attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType);
}

View File

@ -13,8 +13,9 @@ module.exports = {
* @param {String} value String to be tested
* @returns {Boolean} true if it is a plaintext string
*/
isPlainText(value) {
if (typeof value !== 'string' || /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/.test(value)) {
isPlainText(value, isParam) {
const re = isParam ? /[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
if (typeof value !== 'string' || re.test(value)) {
return false;
} else {
return true;
@ -49,11 +50,7 @@ module.exports = {
* @return {String} Single or several mime words joined together
*/
encodeWord(data, mimeWordEncoding, maxLength) {
mimeWordEncoding = (mimeWordEncoding || 'Q')
.toString()
.toUpperCase()
.trim()
.charAt(0);
mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);
maxLength = maxLength || 0;
let encodedStr;
@ -66,10 +63,7 @@ module.exports = {
if (mimeWordEncoding === 'Q') {
// https://tools.ietf.org/html/rfc2047#section-5 rule (3)
encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\-/=]/gi, chr => {
let ord = chr
.charCodeAt(0)
.toString(16)
.toUpperCase();
let ord = chr.charCodeAt(0).toString(16).toUpperCase();
if (chr === ' ') {
return '_';
} else {
@ -131,8 +125,8 @@ module.exports = {
let encodedValue;
// find first word with a non-printable ascii in it
let firstMatch = value.match(/(?:^|\s)([^\s]*[\u0080-\uFFFF])/);
// find first word with a non-printable ascii or special symbol in it
let firstMatch = value.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);
if (!firstMatch) {
return value;
}
@ -144,7 +138,7 @@ module.exports = {
}
// find the last word with a non-printable ascii in it
let lastMatch = value.match(/([\u0080-\uFFFF][^\s]*)[^\u0080-\uFFFF]*$/);
let lastMatch = value.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);
if (!lastMatch) {
// should not happen
return value;
@ -181,7 +175,7 @@ module.exports = {
// filename might include unicode characters so it is a special case
// other values probably do not
let value = structured.params[param];
if (!this.isPlainText(value) || value.length >= 75) {
if (!this.isPlainText(value, true) || value.length >= 75) {
this.buildHeaderParam(param, value, 50).forEach(encodedParam => {
if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {
paramsArray.push(encodedParam.key + '=' + encodedParam.value);
@ -226,7 +220,7 @@ module.exports = {
maxLength = maxLength || 50;
// process ascii only text
if (this.isPlainText(data)) {
if (this.isPlainText(data, true)) {
// check if conversion is even needed
if (encodedStr.length <= maxLength) {
return [
@ -591,10 +585,7 @@ module.exports = {
encodeURICharComponent: chr => {
let res = '';
let ord = chr
.charCodeAt(0)
.toString(16)
.toUpperCase();
let ord = chr.charCodeAt(0).toString(16).toUpperCase();
if (ord.length % 2) {
ord = '0' + ord;

View File

@ -2063,11 +2063,7 @@ module.exports = {
}
let parsed = path.parse(filename);
let extension = (parsed.ext.substr(1) || parsed.name || '')
.split('?')
.shift()
.trim()
.toLowerCase();
let extension = (parsed.ext.substr(1) || parsed.name || '').split('?').shift().trim().toLowerCase();
let value = defaultMimeType;
if (extensions.has(extension)) {
@ -2084,10 +2080,7 @@ module.exports = {
if (!mimeType) {
return defaultExtension;
}
let parts = (mimeType || '')
.toLowerCase()
.trim()
.split('/');
let parts = (mimeType || '').toLowerCase().trim().split('/');
let rootType = parts.shift().trim();
let subType = parts.join('/').trim();

View File

@ -80,11 +80,7 @@ class MimeNode {
/**
* Indicates which encoding should be used for header strings: "Q" or "B"
*/
this.textEncoding = (options.textEncoding || '')
.toString()
.trim()
.charAt(0)
.toUpperCase();
this.textEncoding = (options.textEncoding || '').toString().trim().charAt(0).toUpperCase();
/**
* Immediate parent for this node (or undefined if not set)
@ -441,16 +437,10 @@ class MimeNode {
getTransferEncoding() {
let transferEncoding = false;
let contentType = (this.getHeader('Content-Type') || '')
.toString()
.toLowerCase()
.trim();
let contentType = (this.getHeader('Content-Type') || '').toString().toLowerCase().trim();
if (this.content) {
transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '')
.toString()
.toLowerCase()
.trim();
transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '').toString().toLowerCase().trim();
if (!transferEncoding || !['base64', 'quoted-printable'].includes(transferEncoding)) {
if (/^text\//i.test(contentType)) {
// If there are no special symbols, no need to modify the text
@ -540,6 +530,7 @@ class MimeNode {
}
value = mimeFuncs.buildHeaderValue(structured);
break;
case 'Content-Type':
structured = mimeFuncs.parseHeaderValue(value);
@ -564,6 +555,7 @@ class MimeNode {
value += '; name=' + param;
}
break;
case 'Bcc':
if (!this.keepBcc) {
// skip BCC values
@ -1007,7 +999,7 @@ class MimeNode {
.trim()
.toLowerCase()
// use uppercase words, except MIME
.replace(/^X-SMTPAPI$|^(MIME|DKIM)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase())
.replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase())
// special case
.replace(/^Content-Features$/i, 'Content-features');
@ -1023,7 +1015,7 @@ class MimeNode {
_handleContentType(structured) {
this.contentType = structured.value.trim().toLowerCase();
this.multipart = this.contentType.split('/').reduce((prev, value) => (prev === 'multipart' ? value : false));
this.multipart = /^multipart\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;
if (this.multipart) {
this.boundary = structured.params.boundary = structured.params.boundary || this.boundary || this._generateBoundary();
@ -1109,6 +1101,11 @@ class MimeNode {
value = (value || '').toString().replace(/\r?\n|\r/g, ' ');
return this._encodeWords(value);
case 'Content-Type':
case 'Content-Disposition':
// if it includes a filename then it is already encoded
return (value || '').toString().replace(/\r?\n|\r/g, ' ');
default:
value = (value || '').toString().replace(/\r?\n|\r/g, ' ');
// encodeWords only encodes if needed, otherwise the original string is returned

View File

@ -13,16 +13,11 @@ const packageData = require('../package.json');
const ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\/+$/, '');
const ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\/+$/, '');
const ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes(
(process.env.ETHEREAL_CACHE || 'yes')
.toString()
.trim()
.toLowerCase()
);
const ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase());
let testAccount = false;
module.exports.createTransport = function(transporter, defaults) {
module.exports.createTransport = function (transporter, defaults) {
let urlConfig;
let options;
let mailer;
@ -60,7 +55,7 @@ module.exports.createTransport = function(transporter, defaults) {
return mailer;
};
module.exports.createTestAccount = function(apiUrl, callback) {
module.exports.createTestAccount = function (apiUrl, callback) {
let promise;
if (!callback && typeof apiUrl === 'function') {
@ -128,7 +123,7 @@ module.exports.createTestAccount = function(apiUrl, callback) {
return promise;
};
module.exports.getTestMessageUrl = function(info) {
module.exports.getTestMessageUrl = function (info) {
if (!info || !info.response) {
return false;
}

View File

@ -70,6 +70,14 @@ class SendmailTransport {
let returned;
let transform;
const hasInvalidAddresses = []
.concat(envelope.from || [])
.concat(envelope.to || [])
.some(addr => /^-/.test(addr));
if (hasInvalidAddresses) {
return done(new Error('Can not send mail. Invalid envelope addresses.'));
}
if (this.args) {
// force -i to keep single dots
args = ['-i'].concat(this.args).concat(envelope.to);

View File

@ -38,7 +38,7 @@ class SESTransport extends EventEmitter {
// max messages per second
this.sendingRate = Number(this.options.sendingRate) || Infinity;
this.sendingRateTTL = null;
this.rateInterval = 1000;
this.rateInterval = 1000; // milliseconds
this.rateMessages = [];
this.pending = [];

View File

@ -276,7 +276,7 @@ module.exports.getLogger = (options, defaults) => {
* @param {Function} reject Function to run if callback ends with an error
*/
module.exports.callbackPromise = (resolve, reject) =>
function() {
function () {
let args = Array.from(arguments);
let err = args.shift();
if (err) {
@ -357,7 +357,7 @@ module.exports.resolveContent = (data, key, callback) => {
/**
* Copies properties from source objects to target objects
*/
module.exports.assign = function(/* target, ... sources */) {
module.exports.assign = function (/* target, ... sources */) {
let args = Array.from(arguments);
let target = args.shift() || {};
@ -489,15 +489,7 @@ function createDefaultLogger(levels) {
message = util.format(message, ...args);
message.split(/\r?\n/).forEach(line => {
console.log(
'[%s] %s %s',
new Date()
.toISOString()
.substr(0, 19)
.replace(/T/, ' '),
levelNames.get(level),
prefix + line
);
console.log('[%s] %s %s', new Date().toISOString().substr(0, 19).replace(/T/, ' '), levelNames.get(level), prefix + line);
});
};

View File

@ -44,7 +44,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {
// Error harness for initial connection. Once connection is established, the responsibility
// to handle errors is passed to whoever uses this socket
let finished = false;
let tempSocketErr = function(err) {
let tempSocketErr = function (err) {
if (finished) {
return;
}

View File

@ -45,10 +45,7 @@ class SMTPConnection extends EventEmitter {
constructor(options) {
super(options);
this.id = crypto
.randomBytes(8)
.toString('base64')
.replace(/\W/g, '');
this.id = crypto.randomBytes(8).toString('base64').replace(/\W/g, '');
this.stage = 'init';
this.options = options || {};
@ -73,10 +70,7 @@ class SMTPConnection extends EventEmitter {
this.customAuth = new Map();
Object.keys(this.options.customAuth || {}).forEach(key => {
let mapKey = (key || '')
.toString()
.trim()
.toUpperCase();
let mapKey = (key || '').toString().trim().toUpperCase();
if (!mapKey) {
return;
}
@ -424,11 +418,7 @@ class SMTPConnection extends EventEmitter {
this._auth = authData || {};
// Select SASL authentication method
this._authMethod =
(this._auth.method || '')
.toString()
.trim()
.toUpperCase() || false;
this._authMethod = (this._auth.method || '').toString().trim().toUpperCase() || false;
if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) {
this._authMethod = 'XOAUTH2';
@ -598,7 +588,7 @@ class SMTPConnection extends EventEmitter {
// ensure that callback is only called once
let returned = false;
let callback = function() {
let callback = function () {
if (returned) {
return;
}

View File

@ -41,7 +41,7 @@ function normalizeService(service) {
* @param {String} key [description]
* @returns {Object} SMTP config or false if not found
*/
module.exports = function(key) {
module.exports = function (key) {
key = normalizeKey(key.split('@').pop());
return normalized[key] || false;
};

View File

@ -23,6 +23,12 @@
"port": 25
},
"Ethereal": {
"aliases": ["ethereal.email"],
"host": "smtp.ethereal.email",
"port": 587
},
"FastMail": {
"domains": ["fastmail.fm"],
"host": "smtp.fastmail.com",

View File

@ -163,7 +163,12 @@ class XOAuth2 extends Stream {
iat,
exp: iat + this.options.serviceRequestTimeout
};
let token = this.jwtSignRS256(tokenData);
let token;
try {
token = this.jwtSignRS256(tokenData);
} catch (err) {
return callback(new Error('Can\x27t generate token. Check your auth options'));
}
urlOptions = {
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
@ -256,7 +261,15 @@ class XOAuth2 extends Stream {
);
if (data.error) {
return callback(new Error(data.error));
// Error Response : https://tools.ietf.org/html/rfc6749#section-5.2
let errorMessage = data.error;
if (data.error_description) {
errorMessage += ': ' + data.error_description;
}
if (data.error_uri) {
errorMessage += ' (' + data.error_uri + ')';
}
return callback(new Error(errorMessage));
}
if (data.access_token) {
@ -355,10 +368,7 @@ class XOAuth2 extends Stream {
*/
jwtSignRS256(payload) {
payload = ['{"alg":"RS256","typ":"JWT"}', JSON.stringify(payload)].map(val => this.toBase64URL(val)).join('.');
let signature = crypto
.createSign('RSA-SHA256')
.update(payload)
.sign(this.options.privateKey);
let signature = crypto.createSign('RSA-SHA256').update(payload).sign(this.options.privateKey);
return payload + '.' + this.toBase64URL(signature);
}
}

39
node_modules/nodemailer/package.json generated vendored
View File

@ -1,27 +1,27 @@
{
"_from": "nodemailer@6.4.6",
"_id": "nodemailer@6.4.6",
"_from": "nodemailer@6.4.16",
"_id": "nodemailer@6.4.16",
"_inBundle": false,
"_integrity": "sha512-/kJ+FYVEm2HuUlw87hjSqTss+GU35D4giOpdSfGp7DO+5h6RlJj7R94YaYHOkoxu1CSaM0d3WRBtCzwXrY6MKA==",
"_integrity": "sha512-68K0LgZ6hmZ7PVmwL78gzNdjpj5viqBdFqKrTtr9bZbJYj6BRj5W6WGkxXrEnUl3Co3CBXi3CZBUlpV/foGnOQ==",
"_location": "/nodemailer",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "nodemailer@6.4.6",
"raw": "nodemailer@6.4.16",
"name": "nodemailer",
"escapedName": "nodemailer",
"rawSpec": "6.4.6",
"rawSpec": "6.4.16",
"saveSpec": null,
"fetchSpec": "6.4.6"
"fetchSpec": "6.4.16"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.6.tgz",
"_shasum": "d37f504f6560b36616f646a606894fe18819107f",
"_spec": "nodemailer@6.4.6",
"_resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.16.tgz",
"_shasum": "5cb6391b1d79ab7eff32d6f9f48366b5a7117293",
"_spec": "nodemailer@6.4.16",
"_where": "/home/dawidd6/github/dawidd6/action-send-mail",
"author": {
"name": "Andris Reinman"
@ -34,23 +34,23 @@
"deprecated": false,
"description": "Easy as cake e-mail sending from your Node.js applications",
"devDependencies": {
"bunyan": "1.8.12",
"bunyan": "1.8.14",
"chai": "4.2.0",
"eslint-config-nodemailer": "1.2.0",
"eslint-config-prettier": "6.10.0",
"grunt": "1.1.0",
"eslint-config-prettier": "6.15.0",
"grunt": "1.3.0",
"grunt-cli": "1.3.2",
"grunt-eslint": "22.0.0",
"grunt-eslint": "23.0.0",
"grunt-mocha-test": "0.13.3",
"libbase64": "1.2.1",
"libmime": "4.2.1",
"libmime": "5.0.0",
"libqp": "1.1.0",
"mocha": "7.1.1",
"mocha": "8.2.1",
"nodemailer-ntlm-auth": "1.0.1",
"proxy": "1.0.1",
"proxy": "1.0.2",
"proxy-test-server": "1.0.0",
"sinon": "9.0.1",
"smtp-server": "3.6.0"
"sinon": "9.2.1",
"smtp-server": "3.7.0"
},
"engines": {
"node": ">=6.0.0"
@ -67,8 +67,7 @@
"url": "git+https://github.com/nodemailer/nodemailer.git"
},
"scripts": {
"postinstall": "node -e \"try{require('./postinstall')}catch(e){}\"",
"test": "grunt"
},
"version": "6.4.6"
"version": "6.4.16"
}

View File

@ -5,15 +5,38 @@ const packageData = require('./package.json');
const isEnabled = value => !!value && value !== '0' && value !== 'false';
const canUseColor = isEnabled(process.env.npm_config_color);
const text = `=== Nodemailer ${packageData.version} ===
const title = `=== Nodemailer ${packageData.version} ===`;
const text = `
Thank you for using Nodemailer for your email sending needs! While Nodemailer itself is mostly meant to be a SMTP client there are other related projects in the Nodemailer project as well.
For example:
> IMAP API ( https://imapapi.com ) is a server application to easily access IMAP accounts via REST API
> ImapFlow ( https://imapflow.com/ ) is an async IMAP client library for Node.js
> NodemailerApp ( https://nodemailer.com/app/ ) is a cross platform GUI app to debug emails
> Project Pending ( https://projectpending.com/ ) allows you to host DNS of your project domains
> Pending DNS ( https://pendingdns.com/ ) is the DNS server used that powers Project Pending
> Ethereal Email ( https://ethereal.email/ ) is an email testing service that accepts all your test emails
`;
const footer = `Don't like this message?
There's a Github Sponsors goal to remove it
https://github.com/sponsors/andris9
`;
const secs = 4;
const formatCentered = (row, columns) => {
return row
.split(/\r?\n/)
.map(row => {
if (columns <= row.length) {
return row;
}
return ' '.repeat(Math.round(columns / 2 - row.length / 2)) + row;
})
.join('\n');
};
const formatRow = (row, columns) => {
if (row.length <= columns) {
return [row];
@ -27,10 +50,12 @@ const formatRow = (row, columns) => {
}
let slice = row.substr(0, columns);
let prefix = slice.charAt(0) === '>' ? ' ' : '';
let match = slice.match(/(\s+)[^\s]*$/);
if (match && match.index) {
let line = row.substr(0, match.index);
row = row.substr(line.length + match[1].length);
row = prefix + row.substr(line.length + match[1].length);
lines.push(line);
} else {
lines.push(row);
@ -44,10 +69,14 @@ const wrapText = text => {
let columns = Number(process.stdout.columns) || 80;
columns = Math.min(columns, 80) - 1;
return text
.split('\n')
.flatMap(row => formatRow(row, columns))
.join('\n');
return (
(formatCentered(title, columns) + '\n' + text)
.split('\n')
.flatMap(row => formatRow(row, columns))
.join('\n') +
'\n' +
formatCentered(footer, columns)
);
};
const banner = wrapText(text)
@ -56,3 +85,17 @@ const banner = wrapText(text)
.replace(/(https:[^\s)]+)/g, '\u001B[94m $1 \u001B[96m');
console.log(canUseColor ? banner : banner.replace(/\u001B\[\d+m/g, ''));
if (canUseColor) {
process.stdout.write('\u001B[96m');
}
setInterval(() => {
process.stdout.write('.');
}, 500);
setTimeout(() => {
if (canUseColor) {
process.stdout.write('\u001B[0m\n');
}
process.exit(0);
}, secs * 1000 + 100);

12
package-lock.json generated
View File

@ -5,14 +5,14 @@
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz",
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
},
"nodemailer": {
"version": "6.4.6",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.6.tgz",
"integrity": "sha512-/kJ+FYVEm2HuUlw87hjSqTss+GU35D4giOpdSfGp7DO+5h6RlJj7R94YaYHOkoxu1CSaM0d3WRBtCzwXrY6MKA=="
"version": "6.4.16",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.16.tgz",
"integrity": "sha512-68K0LgZ6hmZ7PVmwL78gzNdjpj5viqBdFqKrTtr9bZbJYj6BRj5W6WGkxXrEnUl3Co3CBXi3CZBUlpV/foGnOQ=="
}
}
}

View File

@ -17,7 +17,7 @@
},
"homepage": "https://github.com/dawidd6/action-send-mail#readme",
"dependencies": {
"@actions/core": "^1.2.3",
"nodemailer": "^6.4.6"
"@actions/core": "^1.2.6",
"nodemailer": "^6.4.16"
}
}