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

28 lines
685 B
TypeScript
Raw Normal View History

import { Octokit } from '@octokit/rest';
const [, , /* node */ /* file */ tag] = process.argv;
// eslint-disable-next-line no-console
console.log('tag', tag);
const octokit = new Octokit({
auth: `token ${process.env.GITHUB_TOKEN}`,
});
(async () => {
try {
// eslint-disable-next-line no-console
await octokit.repos.createRelease({
owner: 'verdaccio',
repo: 'verdaccio',
tag_name: tag,
2023-02-14 16:32:40 -05:00
body: '## Release /n TBA',
draft: true,
discussion_category_name: 'Announcements',
});
} catch (err) {
// eslint-disable-next-line no-console
console.error(`release script has failed, details: ${err}`);
process.exit(1);
}
})();