mirror of
https://github.com/diligencia/semantic-branch-version.git
synced 2024-11-23 16:53: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');
|
const execlib = require('@actions/exec');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const branchName = getBranchName();
|
||||||
|
core.setOutput("branchname", branchName);
|
||||||
|
} catch (error) {
|
||||||
|
core.setFailed(error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getBranchName() {
|
||||||
let output = '';
|
let output = '';
|
||||||
const options = {
|
const options = {
|
||||||
listeners: {
|
listeners: {
|
||||||
@ -10,7 +17,6 @@ try {
|
|||||||
};
|
};
|
||||||
|
|
||||||
await execlib.exec('git', ['branch'], options);
|
await execlib.exec('git', ['branch'], options);
|
||||||
core.setOutput("branchname", output);
|
|
||||||
} catch (error) {
|
return output;
|
||||||
core.setFailed(error.message);
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user