You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core.setFailed(`🙅♂️ The last attempted deployment as returned by the AWS API has been created by a higher run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber}. Aborting.`);
91
-
return;
92
-
}else{
93
-
console.log(`🔎 Last attempted deployment was from run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber} - proceeding.`);
core.setFailed(`🙅♂️ The last attempted deployment as returned by the AWS API has been created by a higher run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber}. Aborting.`);
92
+
return;
93
+
}else{
94
+
console.log(`🔎 Last attempted deployment was from run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber} - proceeding.`);
Copy file name to clipboardExpand all lines: dist/index.js
+14-12
Original file line number
Diff line number
Diff line change
@@ -89,24 +89,26 @@ exports.createDeployment = async function(applicationName, fullRepositoryName, b
89
89
}
90
90
91
91
if (runNumber) {
92
-
var {deploymentGroupInfo: {lastAttemptedDeployment: {deploymentId: lastAttemptedDeploymentId}}} = await codeDeploy.getDeploymentGroup({
92
+
var {deploymentGroupInfo: {lastAttemptedDeployment: {deploymentId: lastAttemptedDeploymentId} = {}}} = await codeDeploy.getDeploymentGroup({
93
93
applicationName: applicationName,
94
94
deploymentGroupName: deploymentGroupName,
95
95
}).promise();
96
96
97
-
var {deploymentInfo: {description: lastAttemptedDeploymentDescription}} = await codeDeploy.getDeployment({
98
-
deploymentId: lastAttemptedDeploymentId,
99
-
}).promise();
97
+
if (lastAttemptedDeploymentId) {
98
+
var {deploymentInfo: {description: lastAttemptedDeploymentDescription}} = await codeDeploy.getDeployment({
99
+
deploymentId: lastAttemptedDeploymentId,
100
+
}).promise();
100
101
101
-
var matches, lastAttemptedDeploymentRunNumber;
102
+
var matches, lastAttemptedDeploymentRunNumber;
102
103
103
-
if (matches = lastAttemptedDeploymentDescription.match(/run_number=(\d+)/)) {
104
-
lastAttemptedDeploymentRunNumber = matches[1];
105
-
if (parseInt(lastAttemptedDeploymentRunNumber) > parseInt(runNumber)) {
106
-
core.setFailed(`🙅♂️ The last attempted deployment as returned by the AWS API has been created by a higher run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber}. Aborting.`);
107
-
return;
108
-
} else {
109
-
console.log(`🔎 Last attempted deployment was from run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber} - proceeding.`);
104
+
if (matches = lastAttemptedDeploymentDescription.match(/run_number=(\d+)/)) {
105
+
lastAttemptedDeploymentRunNumber = matches[1];
106
+
if (parseInt(lastAttemptedDeploymentRunNumber) > parseInt(runNumber)) {
107
+
core.setFailed(`🙅♂️ The last attempted deployment as returned by the AWS API has been created by a higher run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber}. Aborting.`);
108
+
return;
109
+
} else {
110
+
console.log(`🔎 Last attempted deployment was from run number ${lastAttemptedDeploymentRunNumber}, this is run number ${runNumber} - proceeding.`);
0 commit comments