Add then action for promise

This commit is contained in:
koeneijkemans 2020-07-05 08:46:24 +02:00
parent 13f46ab513
commit ac9e9d46b0

View File

@ -2,12 +2,8 @@ const core = require('@actions/core');
const execlib = require('@actions/exec');
try {
const branchName = getBranchName();
core.setOutput("branchname", branchName);
if (branchName) {
console.log('We got it! : ' + branchName);
}
getBranchName()
.then(name => core.setOutput("branchname", name));
} catch (error) {
core.setFailed(error.message);
}