Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingalike committed Jul 16, 2020
1 parent 5bf85a0 commit 0e5ed71
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
24 changes: 12 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const core = require('@actions/core');
"use strict";const core = require('@actions/core');
const AWS = require('aws-sdk');
const github = require('@actions/github');

async function execute() {
function execute() {
try{
const AWS_REGION = core.getInput("AWS_REGION") || process.env.AWS_REGION;
const AWS_ACCESS_KEY_ID = core.getInput("AWS_ACCESS_KEY_ID") || process.env.AWS_ACCESS_KEY_ID;
Expand All @@ -22,17 +22,17 @@ async function execute() {
TopicArn: TOPIC_ARN
};

const publishTextPromise = new AWS.SNS({ apiVersion: "2010-03-31" })
.publish(params)
.promise();
const awsClient = new AWS.SNS({ apiVersion: "2010-03-31" });

core.debug("Sending SMS");

const { MessageId } = await publishTextPromise();

core.debug("SMS sent!");

return MessageId;
awsClient.publish(params, function(err, data) {
if (err) core.setFailed(err.Message); // an error occurred
else {
core.debug("Sending SMS");
const { MessageId } = await publishTextPromise();
core.debug("SMS sent!");
return MessageId;
}
});
}catch(error) {
core.setFailed(error.message);
}
Expand Down
22 changes: 11 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const core = require('@actions/core');
const AWS = require('aws-sdk');
const github = require('@actions/github');

async function execute() {
function execute() {
try{
const AWS_REGION = core.getInput("AWS_REGION") || process.env.AWS_REGION;
const AWS_ACCESS_KEY_ID = core.getInput("AWS_ACCESS_KEY_ID") || process.env.AWS_ACCESS_KEY_ID;
Expand All @@ -22,17 +22,17 @@ async function execute() {
TopicArn: TOPIC_ARN
};

const publishTextPromise = new AWS.SNS({ apiVersion: "2010-03-31" })
.publish(params)
.promise();
const awsClient = new AWS.SNS({ apiVersion: "2010-03-31" });

core.debug("Sending SMS");

const { MessageId } = await publishTextPromise();

core.debug("SMS sent!");

return MessageId;
awsClient.publish(params, function(err, data) {
if (err) core.setFailed(err.Message); // an error occurred
else {
core.debug("Sending SMS");
const { MessageId } = await publishTextPromise();
core.debug("SMS sent!");
return MessageId;
}
});
}catch(error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 0e5ed71

Please sign in to comment.