mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 16:53:51 +08:00
Improve the exec call
This commit is contained in:
parent
e76ec1aae8
commit
fbd3dd9e5c
16
index.js
16
index.js
@ -1,16 +1,16 @@
|
|||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const exec = require('@actions/exec');
|
const execlib = require('@actions/exec');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options ={};
|
|
||||||
let output = '';
|
let output = '';
|
||||||
options.listeners = {
|
const options = {
|
||||||
stdout: (data) => {
|
listeners: {
|
||||||
output += data.toString();
|
stdout: (data) => output += data.toString()
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
exec('git', 'branch', options)
|
|
||||||
|
execlib.exec('git', ['branch'], options)
|
||||||
core.setOutput("branchname", output);
|
core.setOutput("branchname", output);
|
||||||
} catch (errror) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user