@@ -160413,22 +160413,21 @@ async function startEc2Instance(label, githubRegistrationToken) {
160413160413 }
160414160414 }
160415160415
160416- try {
160417- const ec2 = new EC2Client({region: process.env.AWS_REGION});
160418- const runInstancesCommand = new RunInstancesCommand(params);
160419- ec2.send(runInstancesCommand, (err, data) => {
160420- if (err) {
160421- console.log(err, err.stack);
160422- } else {
160423- const ec2InstanceIds = data.Instances.map(x => x.InstanceId); //[0].InstanceId; pass all instances instead of just first id
160424- core.info(`AWS EC2 instance(s) ${ec2InstanceIds} is started`);
160425- return ec2InstanceIds;
160426- }
160427- });
160428- } catch (error) {
160429- core.error('AWS EC2 instance starting error');
160430- throw error;
160431- }
160416+ const ec2 = new EC2Client({region: process.env.AWS_REGION});
160417+
160418+ const runInstancesCommand = new RunInstancesCommand(params);
160419+
160420+ ec2.send(runInstancesCommand, (err, data) => {
160421+ if (err) {
160422+ console.log(err, err.stack);
160423+ core.error(`AWS EC2 instance failed to start - error: ${err}`)
160424+ throw err;
160425+ } else {
160426+ const ec2InstanceIds = data.Instances.map(x => x.InstanceId); //[0].InstanceId; pass all instances instead of just first id
160427+ core.info(`AWS EC2 instance(s) ${ec2InstanceIds} is started`);
160428+ return ec2InstanceIds;
160429+ }
160430+ });
160432160431}
160433160432
160434160433async function terminateEc2Instance() {
@@ -160452,7 +160451,6 @@ async function terminateEc2Instance() {
160452160451
160453160452async function waitForInstanceRunning(ec2InstanceId) {
160454160453 core.info(`waitForInstanceRunning: ${ec2InstanceId}`)
160455- core.info(`region: ${process.env.AWS_REGION}`)
160456160454 const ec2 = new EC2Client({region: process.env.AWS_REGION});
160457160455
160458160456 try {
@@ -160928,6 +160926,7 @@ const config = __nccwpck_require__(34570);
160928160926const core = __nccwpck_require__(42186);
160929160927
160930160928function setOutput(label, ec2InstanceId) {
160929+ core.debug(`Setting outputs: label=${label} ec2-instance-id=${ec2InstanceId}`)
160931160930 core.setOutput('label', label);
160932160931 core.setOutput('ec2-instance-id', ec2InstanceId);
160933160932}
0 commit comments