mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 16:23:50 +08:00
add some logging
This commit is contained in:
parent
abe0a38a7e
commit
3322e0d482
13
index.js
13
index.js
@ -4,6 +4,10 @@ const execlib = require('@actions/exec');
|
|||||||
try {
|
try {
|
||||||
const branchName = getBranchName();
|
const branchName = getBranchName();
|
||||||
core.setOutput("branchname", branchName);
|
core.setOutput("branchname", branchName);
|
||||||
|
|
||||||
|
if (branchName) {
|
||||||
|
console.log('We got it! : ' + branchName);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
@ -12,11 +16,18 @@ async function getBranchName() {
|
|||||||
let output = '';
|
let output = '';
|
||||||
const options = {
|
const options = {
|
||||||
listeners: {
|
listeners: {
|
||||||
stdout: (data) => output += data.toString()
|
stdout: (data) => {
|
||||||
|
output += data.toString();
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
await execlib.exec('git', ['branch'], options);
|
await execlib.exec('git', ['branch'], options);
|
||||||
|
|
||||||
|
if (output) {
|
||||||
|
console.log('Got some sweet output...' + output);
|
||||||
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user