How to generate changelog for GitHub releases with rxjs and node

Issue #398

How to

Technical

Dependencies

1
2
3
4
const Rx = require('rxjs/Rx')
const Fetch = require('node-fetch')
const Minimist = require('minimist')
const Fs = require('fs')

Use GraphQL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
makeOptions(query, token) {
return {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `bearer ${token}`
},
body: JSON.stringify({
query: `
query {
repository(owner: "${this.owner}", name: "${this.repo}") {
${query}
}
}
`
})
}
}

Use orderBy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
fetchPRsAndIssues(dates) {
const query = `
pullRequests(last: 100, orderBy: {field: UPDATED_AT, direction: ASC}) {
edges {
node {
title
merged
mergedAt
url
author {
login
url
}
}
}
}
issues(last: 100, orderBy: {field: UPDATED_AT, direction: ASC}) {
edges {
node {
title
closed
updatedAt
url
}
}
}
}
}

Comments