mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-25 03:09:00 -06:00
/.github/{actions,workflows}: iterating on email using template
This commit is contained in:
4
.github/actions/ses-email-action/action.yaml
vendored
4
.github/actions/ses-email-action/action.yaml
vendored
@@ -5,6 +5,10 @@ inputs:
|
||||
description: 'aws region'
|
||||
required: true
|
||||
default: ''
|
||||
version:
|
||||
description: 'dolt version being benchmarked'
|
||||
required: true
|
||||
default: ''
|
||||
dataFile:
|
||||
required: true
|
||||
description: 'path to email data file'
|
||||
|
||||
27
.github/actions/ses-email-action/dist/index.js
vendored
27
.github/actions/ses-email-action/dist/index.js
vendored
@@ -10,6 +10,7 @@ const aws = __webpack_require__(32197);
|
||||
const fs = __webpack_require__(35747);
|
||||
|
||||
const region = core.getInput('region');
|
||||
const version = core.getInput('version');
|
||||
const dataFilePath = core.getInput('dataFile');
|
||||
const CcAddresses = JSON.parse(core.getInput('ccAddresses'));
|
||||
const ToAddresses = JSON.parse(core.getInput('toAddresses'));
|
||||
@@ -17,6 +18,11 @@ const ReplyToAddresses = JSON.parse(core.getInput('replyToAddresses'));
|
||||
|
||||
const data = fs.readFileSync(dataFilePath, { encoding: 'utf-8' });
|
||||
|
||||
const templated = {
|
||||
version,
|
||||
results: data,
|
||||
};
|
||||
|
||||
// Set the region
|
||||
aws.config.update({ region });
|
||||
|
||||
@@ -26,28 +32,15 @@ const params = {
|
||||
CcAddresses,
|
||||
ToAddresses,
|
||||
},
|
||||
Message: { /* required */
|
||||
Body: { /* required */
|
||||
Html: {
|
||||
Charset: "UTF-8",
|
||||
Data: `This is the first part of the email.\n ${data}`
|
||||
},
|
||||
// Text: {
|
||||
// Charset: "UTF-8",
|
||||
// Data: "TEXT_FORMAT_BODY"
|
||||
// }
|
||||
},
|
||||
Subject: {
|
||||
Charset: 'UTF-8',
|
||||
Data: 'Test email'
|
||||
}
|
||||
},
|
||||
Source: 'dustin@dolthub.com', /* required */
|
||||
Template: 'PerformanceBenchmarkingReleaseTemplate',
|
||||
TemplateData: JSON.stringify(templated),
|
||||
ReplyToAddresses,
|
||||
};
|
||||
|
||||
// Create the promise and SES service object
|
||||
const sendPromise = new aws.SES({apiVersion: '2010-12-01'}).sendEmail(params).promise();
|
||||
// const sendPromise = new aws.SES({apiVersion: '2010-12-01'}).sendEmail(params).promise();
|
||||
const sendPromise = new aws.SES({apiVersion: '2010-12-01'}).sendTemplatedEmail(params).promise();
|
||||
|
||||
// Handle promise's fulfilled/rejected states
|
||||
sendPromise
|
||||
|
||||
27
.github/actions/ses-email-action/index.js
vendored
27
.github/actions/ses-email-action/index.js
vendored
@@ -3,6 +3,7 @@ const aws = require('aws-sdk');
|
||||
const fs = require('fs');
|
||||
|
||||
const region = core.getInput('region');
|
||||
const version = core.getInput('version');
|
||||
const dataFilePath = core.getInput('dataFile');
|
||||
const CcAddresses = JSON.parse(core.getInput('ccAddresses'));
|
||||
const ToAddresses = JSON.parse(core.getInput('toAddresses'));
|
||||
@@ -10,6 +11,11 @@ const ReplyToAddresses = JSON.parse(core.getInput('replyToAddresses'));
|
||||
|
||||
const data = fs.readFileSync(dataFilePath, { encoding: 'utf-8' });
|
||||
|
||||
const templated = {
|
||||
version,
|
||||
results: data,
|
||||
};
|
||||
|
||||
// Set the region
|
||||
aws.config.update({ region });
|
||||
|
||||
@@ -19,28 +25,15 @@ const params = {
|
||||
CcAddresses,
|
||||
ToAddresses,
|
||||
},
|
||||
Message: { /* required */
|
||||
Body: { /* required */
|
||||
Html: {
|
||||
Charset: "UTF-8",
|
||||
Data: `This is the first part of the email.\n ${data}`
|
||||
},
|
||||
// Text: {
|
||||
// Charset: "UTF-8",
|
||||
// Data: "TEXT_FORMAT_BODY"
|
||||
// }
|
||||
},
|
||||
Subject: {
|
||||
Charset: 'UTF-8',
|
||||
Data: 'Test email'
|
||||
}
|
||||
},
|
||||
Source: 'dustin@dolthub.com', /* required */
|
||||
Template: 'PerformanceBenchmarkingReleaseTemplate',
|
||||
TemplateData: JSON.stringify(templated),
|
||||
ReplyToAddresses,
|
||||
};
|
||||
|
||||
// Create the promise and SES service object
|
||||
const sendPromise = new aws.SES({apiVersion: '2010-12-01'}).sendEmail(params).promise();
|
||||
// const sendPromise = new aws.SES({apiVersion: '2010-12-01'}).sendEmail(params).promise();
|
||||
const sendPromise = new aws.SES({apiVersion: '2010-12-01'}).sendTemplatedEmail(params).promise();
|
||||
|
||||
// Handle promise's fulfilled/rejected states
|
||||
sendPromise
|
||||
|
||||
8
.github/actions/ses-email-action/performance-benchmarking-release-template.json
vendored
Normal file
8
.github/actions/ses-email-action/performance-benchmarking-release-template.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Template": {
|
||||
"TemplateName": "PerformanceBenchmarkingReleaseTemplate",
|
||||
"SubjectPart": "Performance Benchmarks for {{version}}!",
|
||||
"HtmlPart": "<h1>Results for {{version}},</h1><div>{{results}}.</div>",
|
||||
"TextPart": "Results for {{version}},\r\n{{results}}"
|
||||
}
|
||||
}
|
||||
@@ -26,5 +26,6 @@ jobs:
|
||||
uses: ./.github/actions/ses-email-action
|
||||
with:
|
||||
region: us-west-2
|
||||
version: 'test-version-0.22.11'
|
||||
toAddresses: '["dustin@dolthub.com"]'
|
||||
dataFile: ${{ format('{0}/results.log', github.workspace) }}
|
||||
|
||||
Reference in New Issue
Block a user