Add Changelog generator

This commit is contained in:
Eric Fennis
2021-02-21 18:57:11 +01:00
parent 381dca62d1
commit 7f1dc27ee3
4 changed files with 98 additions and 23 deletions

22
scripts/githubApi.js Normal file
View File

@@ -0,0 +1,22 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import fetch, { Headers } from 'node-fetch';
const githubApi = async endpoint => {
const headers = new Headers();
const username = 'ericfennis';
const password = process.env.GITHUB_API_KEY;
headers.set(
'Authorization',
`Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`,
);
const res = await fetch(endpoint, {
method: 'GET',
headers,
});
return res.json();
};
export default githubApi;