Skip to content

Commit

Permalink
chore: send benchmark dispatch to correct repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Sep 13, 2023
1 parent d46d052 commit 0dc6332
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- '*'
paths:
- lib/**
- workspaces/**/lib/**
issue_comment:
types:
- created
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
} = context
if (eventName === 'pull_request' && !process.env.GITHUB_TOKEN) {
console.log('No GITHUB_TOKEN - from fork pull request, exiting')
core.info('No GITHUB_TOKEN - from fork pull request, exiting')
return
}
Expand All @@ -47,7 +48,7 @@ jobs:
username: payload.comment.user.login,
})
if (res.data.permission !== 'admin') {
console.log(`Commenter is not an admin, exiting`)
core.info(`Commenter is not an admin, exiting`)
return
}
Expand All @@ -65,14 +66,21 @@ jobs:
repo,
pull_number: number,
}).then(r => r.data)
core.info(`Pull request: ${pullRequest.number}`)
core.info(`Base ref: ${pullRequest.base.ref}`)
const matchesRelease = pullRequest.base.ref.match(/^release\/v(\d+)$/)
const targetSpec = matchesRelease ? matchesRelease[1] : 'latest'
core.info(`Target spec: ${targetSpec}`)
const eventType = `"${eventName} ${owner}/${repo}#${pullRequest.number}"`
core.info(`Event type: ${eventType}`)
await github.rest.repos.createDispatchEvent({
owner,
repo,
event_type: `"${eventName} ${owner}/${repo}#${number}"`,
owner: 'npm',
repo: 'benchmarks',
event_type: eventType,
client_payload: {
owner,
repo,
Expand Down

0 comments on commit 0dc6332

Please sign in to comment.