MCPcopy Create free account
hub / github.com/electric-sql/electric / findPRForCommit

Function findPRForCommit

scripts/comment-on-release.mjs:157–174  ·  view source on GitHub ↗
(commitHash)

Source from the content-addressed store, hash-verified

155}
156
157async function findPRForCommit(commitHash) {
158 try {
159 // Use gh CLI to find PR associated with commit
160 const result = execSync(
161 `gh api repos/${REPO}/commits/${commitHash}/pulls --jq '.[0].number'`,
162 { encoding: `utf8`, stdio: [`pipe`, `pipe`, `pipe`] }
163 ).trim()
164
165 if (result && result !== `null`) {
166 console.log(` Commit ${commitHash} -> PR #${result}`)
167 return parseInt(result, 10)
168 }
169 } catch (e) {
170 // Commit might not be associated with a PR (direct push)
171 console.log(` Commit ${commitHash} has no associated PR`)
172 }
173 return null
174}
175
176async function commentOnPR(prNumber, packages) {
177 const packageList = packages

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected