mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 10:03:51 +08:00
await should be in a function
This commit is contained in:
parent
e035f0c08a
commit
96d1be5d2b
12
index.js
12
index.js
@ -2,6 +2,13 @@ const core = require('@actions/core');
|
||||
const execlib = require('@actions/exec');
|
||||
|
||||
try {
|
||||
const branchName = getBranchName();
|
||||
core.setOutput("branchname", branchName);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
||||
async function getBranchName() {
|
||||
let output = '';
|
||||
const options = {
|
||||
listeners: {
|
||||
@ -10,7 +17,6 @@ try {
|
||||
};
|
||||
|
||||
await execlib.exec('git', ['branch'], options);
|
||||
core.setOutput("branchname", output);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
||||
return output;
|
||||
}
|
Loading…
Reference in New Issue
Block a user