0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/scripts/trigger-release.js

32 lines
629 B
JavaScript
Raw Normal View History

/**
* @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()
2020-08-13 16:36:23 -05:00
.then((changelog) =>
octokit.repos.createRelease({
owner: repoOwner,
repo: repoName,
tag_name: tag,
body: changelog,
2021-03-10 16:08:25 -05:00
draft: false,
})
)
2020-08-13 16:36:23 -05:00
.catch((err) => {
// eslint-disable-next-line no-console
console.error(err);
process.exit(1);
});