forked from aws-actions/aws-codebuild-run-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (26 loc) · 742 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
const core = require("@actions/core");
const { runBuild } = require("./code-build");
const assert = require("assert");
/* istanbul ignore next */
if (require.main === module) {
run();
}
module.exports = run;
async function run() {
console.log("*****STARTING CODEBUILD*****");
try {
const build = await runBuild();
core.setOutput("aws-build-id", build.id);
// Signal the outcome
assert(
build.buildStatus === "SUCCEEDED",
`Build status: ${build.buildStatus}`
);
} catch (error) {
core.setFailed(error.message);
} finally {
console.log("*****CODEBUILD COMPLETE*****");
}
}