MCPcopy
hub / github.com/vercel/next.js / getCommitPullRequest

Function getCommitPullRequest

release.js:14–34  ·  view source on GitHub ↗
(commit, github)

Source from the content-addressed store, hash-verified

12const prNumberRegex = /\(#([-0-9]+)\)$/
13
14const getCommitPullRequest = async (commit, github) => {
15 const match = prNumberRegex.exec(commit.title)
16
17 if (!match) {
18 return null
19 }
20
21 const number = parseInt(match[1], 10)
22
23 if (!number) {
24 return null
25 }
26
27 const { data } = await github.connection.pullRequests.get({
28 owner: github.repoDetails.user,
29 repo: github.repoDetails.repo,
30 number,
31 })
32
33 return data
34}
35
36const getSectionForPullRequest = (pullRequest) => {
37 const { labels } = pullRequest

Callers 1

groupByLabelsFunction · 0.85

Calls 3

execMethod · 0.65
getMethod · 0.65
parseIntFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…