Improve the exec call

This commit is contained in:
koeneijkemans 2020-07-04 17:47:33 +02:00
parent e76ec1aae8
commit fbd3dd9e5c

View File

@ -1,16 +1,16 @@
const core = require('@actions/core');
const exec = require('@actions/exec');
const execlib = require('@actions/exec');
try {
const options ={};
let output = '';
options.listeners = {
stdout: (data) => {
output += data.toString();
const options = {
listeners: {
stdout: (data) => output += data.toString()
}
}
exec('git', 'branch', options)
};
execlib.exec('git', ['branch'], options)
core.setOutput("branchname", output);
} catch (errror) {
} catch (error) {
core.setFailed(error.message);
}