diff --git a/build/release.zip b/build/release.zip index 57705b3..46fdfe9 100644 Binary files a/build/release.zip and b/build/release.zip differ diff --git a/package-lock.json b/package-lock.json index bea8824..5d746d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aws-to-slack", - "version": "1.1.8", + "version": "1.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f77f114..2ce892f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-to-slack", - "version": "1.1.8", + "version": "1.1.9", "description": "Forward AWS Notification Messages to Slack", "main": "src/index.js", "scripts": { diff --git a/src/parsers/codepipeline-approval.js b/src/parsers/codepipeline-approval.js index bb6a36b..127bb2b 100644 --- a/src/parsers/codepipeline-approval.js +++ b/src/parsers/codepipeline-approval.js @@ -10,7 +10,7 @@ class CodePipelineApprovalParser { //console.log("CodePipeline.Approval :: start..."); //console.log(_.get(event, "Records[0].Sns.Message", "{}")); return BbPromise.try(() => - JSON.parse(_.get(event, "Records[0].Sns.Message", "{}"))) + JSON.parse(_.get(event, "Records[0].Sns.Message", "{}"))) .catch(_.noop) // ignore JSON errors .then(message => { @@ -21,17 +21,16 @@ class CodePipelineApprovalParser { console.log(" this IS an APPROVAL message"); - //const detailType = message.detail-type; const pipeline = message.approval.pipelineName; const stage = message.approval.stageName; - const action = message.approval.actionName; - const expires = new Date(message.approval.expires); + // const action = message.approval.actionName; + // const expires = new Date(message.approval.expires); const reviewLink = message.approval.externalEntityLink; const approveLink = message.approval.approvalReviewLink; const customMsg = message.approval.customData; const time = new Date(_.get(event, "Records[0].Sns.Timestamp")); - var slackTitle = pipeline + " >> APPROVAL REQUIRED for " + stage; + const slackTitle = pipeline + " >> APPROVAL REQUIRED for " + stage; const slackMessage = { attachments: [{ diff --git a/src/parsers/codepipeline.js b/src/parsers/codepipeline.js index 03d0413..8c8b1e0 100644 --- a/src/parsers/codepipeline.js +++ b/src/parsers/codepipeline.js @@ -7,10 +7,8 @@ const BbPromise = require("bluebird"), class CodePipelineParser { parse(event) { - //console.log("CodePipeline :: start..."); - //console.log(_.get(event, "Records[0].Sns.Message", "{}")); return BbPromise.try(() => - JSON.parse(_.get(event, "Records[0].Sns.Message", "{}"))) + JSON.parse(_.get(event, "Records[0].Sns.Message", "{}"))) .catch(_.noop) // ignore JSON errors .then(message => { @@ -19,8 +17,6 @@ class CodePipelineParser { return BbPromise.resolve(false); } - const source = message.source; - // Check that this is NOT an approval message (there is a separate handler for those...) // NOTE: CodePipeline Action Execution State Changes that are APPROVALs are handled here, // only ignore the dedicated Approval request notifications @@ -37,7 +33,7 @@ class CodePipelineParser { const time = new Date(message.time); // Compose the title based upon the best "one line" summary of the state - var slackTitle = pipeline + " >> "; + let slackTitle = pipeline + " >> "; if(typeProvider == "Manual" && typeCategory == "Approval") { slackTitle += "APPROVAL REQUIRED for " + stage; }