Fix versioning for push event.

This commit is contained in:
Webber
2020-05-01 13:57:42 +02:00
committed by Webber Takken
parent 40564afbaf
commit d01e844eea
6 changed files with 76 additions and 10 deletions

View File

@@ -1,9 +1,11 @@
import * as core from '@actions/core';
import { exec } from '@actions/exec';
class System {
static async run(command, arguments_, options) {
let result = '';
let error = '';
let debug = '';
const listeners = {
stdout: dataBuffer => {
@@ -12,13 +14,29 @@ class System {
stderr: dataBuffer => {
error += dataBuffer.toString();
},
debug: dataString => {
debug += dataString.toString();
},
};
const exitCode = await exec(command, arguments_, { ...options, listeners });
if (debug !== '') {
core.debug(debug);
}
if (result !== '') {
core.info(result);
}
if (exitCode !== 0) {
throw new Error(error);
}
if (error !== '') {
core.warning(error);
}
return result;
}
}