mirror of
https://github.com/SomboChea/ui
synced 2024-11-16 19:24:28 +07:00
4a459df463
* chore: fixes snapshots test * chore: adds github actions, issue and feat templates * chore: fixes eslint * chore: remvoes circle ci and adds publish action * chore: adds github-release automation using actions
26 lines
624 B
JavaScript
26 lines
624 B
JavaScript
"use strict";
|
|
|
|
const [ /* node */, /* file */, tag] = process.argv;
|
|
|
|
const getStdin = require("get-stdin");
|
|
const Octokit = require('@octokit/rest');
|
|
const octokit = new Octokit({
|
|
auth: `token ${process.env.GITHUB_TOKEN}`,
|
|
});
|
|
|
|
|
|
const [repoOwner, repoName] = process.env.GITHUB_REPOSITORY.split("/");
|
|
|
|
getStdin()
|
|
.then(changelog => octokit.repos.createRelease({
|
|
owner: repoOwner,
|
|
repo: repoName,
|
|
tag_name: tag,
|
|
body: changelog,
|
|
draft: true,
|
|
}))
|
|
.catch(err => {
|
|
// eslint-disable-next-line no-console
|
|
console.error(err);
|
|
process.exit(1);
|
|
}); |