Skip to content

Commit 28cca96

Browse files
authored
Merge pull request #24 from dscho/fix-openssl-version
/open pr: handle multiple underscores in the reported version
2 parents bbc0f5d + 2dbcda9 commit 28cca96

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const guessComponentUpdateDetails = (title, body) => {
1212

1313
version = version
1414
.replace(/^(GCM |openssl-|OpenSSL_|v|V_|GnuTLS |tig-|Heimdal |cygwin-|PCRE2-|Bash-)/, '')
15-
.replace(/_|\s+patch\s+/, '.')
15+
.replace(/\s+patch\s+/, '.')
16+
.replace(/_/g, '.')
1617
.replace(/-release$/, '')
1718

1819
return { package_name, version }

test-open-pr.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\/(\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 { title, body } = await githubApiRequest(
12+
console,
13+
null,
14+
'GET',
15+
`/repos/${owner}/${repo}/issues/${number}`
16+
)
17+
18+
const { guessComponentUpdateDetails } = require('./GitForWindowsHelper/component-updates')
19+
const details = await guessComponentUpdateDetails(title, body)
20+
console.log(details)
21+
})().catch(console.log)

test-pr-comment-delivery.js

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env node
2+
13
(async () => {
24
const fs = require('fs')
35

0 commit comments

Comments
 (0)