mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
build
This commit is contained in:
@@ -20,9 +20,10 @@ const exec = __importStar(require("@actions/exec"));
|
||||
function execute(executable, root, argv) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let publishing = false;
|
||||
let buildScanLink = null;
|
||||
yield exec.exec(executable, argv, {
|
||||
let buildScanUrl;
|
||||
const status = yield exec.exec(executable, argv, {
|
||||
cwd: root,
|
||||
ignoreReturnCode: true,
|
||||
listeners: {
|
||||
stdline: (line) => {
|
||||
if (line.startsWith("Publishing build scan...")) {
|
||||
@@ -32,21 +33,19 @@ function execute(executable, root, argv) {
|
||||
publishing = false;
|
||||
}
|
||||
if (publishing && line.startsWith("http")) {
|
||||
buildScanLink = line.trim();
|
||||
buildScanUrl = line.trim();
|
||||
publishing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (buildScanLink != null) {
|
||||
return new BuildResultImpl(buildScanLink.toString());
|
||||
}
|
||||
return new BuildResultImpl(null);
|
||||
return new BuildResultImpl(status, buildScanUrl);
|
||||
});
|
||||
}
|
||||
exports.execute = execute;
|
||||
class BuildResultImpl {
|
||||
constructor(buildScanUrl) {
|
||||
constructor(status, buildScanUrl) {
|
||||
this.status = status;
|
||||
this.buildScanUrl = buildScanUrl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user