semantic-branch-version/index.js

16 lines
373 B
JavaScript
Raw Normal View History

const core = require('@actions/core');
2020-07-04 23:47:33 +08:00
const execlib = require('@actions/exec');
try {
let output = '';
2020-07-04 23:47:33 +08:00
const options = {
listeners: {
stdout: (data) => output += data.toString()
}
};
2020-07-05 00:39:30 +08:00
yield execlib.exec('git', ['branch'], options)
core.setOutput("branchname", output);
2020-07-04 23:47:33 +08:00
} catch (error) {
core.setFailed(error.message);
}