mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
32 lines
625 B
JavaScript
32 lines
625 B
JavaScript
/**
|
|
* @prettier
|
|
*/
|
|
|
|
'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: false,
|
|
})
|
|
)
|
|
.catch(err => {
|
|
// eslint-disable-next-line no-console
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|