Skip to content

Commit 3382b15

Browse files
committed
Add a script to test guessing release notes manually
It is easier this way to figure out why things go awry that way. This script can be used like this: ./test-guess-relnote.js git-for-windows/git#4164 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent bbc0f5d commit 3382b15

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test-guess-relnote.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
3+
(async () => {
4+
// Expect a URL
5+
const url = process.argv[2]
6+
const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/(?:issues|pulls?)\/(\d+)\/?$/)
7+
if (!match) throw new Error(`Unhandled URL: ${url}`)
8+
const [, owner, repo, number ] = match
9+
10+
const githubApiRequest = require('./GitForWindowsHelper/github-api-request')
11+
const issue = await githubApiRequest(
12+
console,
13+
null,
14+
'GET',
15+
`/repos/${owner}/${repo}/issues/${number}`
16+
)
17+
18+
const { guessReleaseNotes } = require('./GitForWindowsHelper/component-updates')
19+
const guessed = await guessReleaseNotes(issue)
20+
console.log(JSON.stringify(guessed, null, 2))
21+
})().catch(console.log)

0 commit comments

Comments
 (0)