Use a GitHub Action to generate the changelog (#9434) [skip ci]

* Use a GitHub Action to generate the changelog

* Update main.workflow [skip ci]
This commit is contained in:
Nicolò Ribaudo
2019-02-04 22:15:44 +01:00
committed by GitHub
parent 344d35bbe9
commit 44d8a59361
7 changed files with 1527 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
"use strict";
const [ /* node */, /* file */, tag ] = process.argv;
const getStdin = require("get-stdin");
const octokit = require("@octokit/rest")();
octokit.authenticate({
type: "token",
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,
}))
.catch(err => {
console.error(err);
process.exit(1);
});