Skip to content

Commit d3e3da9

Browse files
authored
Merge pull request #1 from siemhesda/patch-3-1
Patch 3 1
2 parents 6c7d50c + c256036 commit d3e3da9

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- '*'
77
paths:
88
- lib/**
9+
- workspaces/**/lib/**
910
issue_comment:
1011
types:
1112
- created
@@ -36,7 +37,7 @@ jobs:
3637
} = context
3738
3839
if (eventName === 'pull_request' && !process.env.GITHUB_TOKEN) {
39-
console.log('No GITHUB_TOKEN - from fork pull request, exiting')
40+
core.info('No GITHUB_TOKEN - from fork pull request, exiting')
4041
return
4142
}
4243
@@ -47,7 +48,7 @@ jobs:
4748
username: payload.comment.user.login,
4849
})
4950
if (res.data.permission !== 'admin') {
50-
console.log(`Commenter is not an admin, exiting`)
51+
core.info(`Commenter is not an admin, exiting`)
5152
return
5253
}
5354
@@ -65,14 +66,21 @@ jobs:
6566
repo,
6667
pull_number: number,
6768
}).then(r => r.data)
69+
70+
core.info(`Pull request: ${pullRequest.number}`)
71+
core.info(`Base ref: ${pullRequest.base.ref}`)
6872
6973
const matchesRelease = pullRequest.base.ref.match(/^release\/v(\d+)$/)
7074
const targetSpec = matchesRelease ? matchesRelease[1] : 'latest'
75+
core.info(`Target spec: ${targetSpec}`)
76+
77+
const eventType = `"${eventName} ${owner}/${repo}#${pullRequest.number}"`
78+
core.info(`Event type: ${eventType}`)
7179
7280
await github.rest.repos.createDispatchEvent({
73-
owner,
74-
repo,
75-
event_type: `"${eventName} ${owner}/${repo}#${number}"`,
81+
owner: 'npm',
82+
repo: 'benchmarks',
83+
event_type: eventType,
7684
client_payload: {
7785
owner,
7886
repo,

lib/commands/bugs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ class Bugs extends PackageUrlCmd {
2121

2222
// try to get it from the repo, if possible
2323
const info = this.hostedFromMani(mani)
24-
if (info) {
25-
return info.bugs()
24+
const infoUrl = info?.bugs()
25+
if (infoUrl) {
26+
return infoUrl
2627
}
2728

2829
// just send them to the website, hopefully that has some info!

lib/commands/doctor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const subcommands = [
9999
]
100100
const BaseCommand = require('../base-command.js')
101101
class Doctor extends BaseCommand {
102-
static description = 'Check your npm environment'
102+
static description = 'Check the health of your npm environment'
103103
static name = 'doctor'
104104
static params = ['registry']
105105
static ignoreImplicitWorkspace = false

test/lib/commands/bugs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const pacote = {
66
return spec === 'nobugs' ? {
77
name: 'nobugs',
88
version: '1.2.3',
9+
} : spec === 'nullbugs' ? {
10+
name: 'nullbugs',
11+
version: '1.2.3',
12+
bugs: null,
913
} : spec === 'bugsurl' ? {
1014
name: 'bugsurl',
1115
version: '1.2.3',
@@ -66,6 +70,7 @@ t.test('open bugs urls & emails', async t => {
6670
const expected = {
6771
'.': 'https://example.com',
6872
nobugs: 'https://www.npmjs.com/package/nobugs',
73+
nullbugs: 'https://www.npmjs.com/package/nullbugs',
6974
'bugsobj-nourl': 'https://www.npmjs.com/package/bugsobj-nourl',
7075
bugsurl: 'https://bugzilla.localhost/bugsurl',
7176
bugsobj: 'https://bugzilla.localhost/bugsobj',

0 commit comments

Comments
 (0)