clangd/.github/actions/pick/index.js
Sam McCall 4f775f56b7
Add automatic weekly snapshot releases with Github Actions (#278)
Add automatic weekly snapshot releases with Github Actions
2020-02-17 18:41:16 +01:00

19 lines
467 B
JavaScript

const core = require('@actions/core');
const last = require('last-successful-gh-commit').default;
try {
var parts = core.getInput('repo').split('/', 2);
last({
owner: parts[0],
name: parts[1],
token: core.getInput('token'),
})
.then(commit => core.setOutput('sha', commit.node.oid))
.catch(error => {
console.error(error);
core.setFailed(error.message);
});
} catch (error) {
console.error(error);
core.setFailed(error.message);
}