MCPcopy Create free account
hub / github.com/EndBug/version-check / getCommit

Function getCommit

src/main.ts:402–411  ·  view source on GitHub ↗
(sha: string)

Source from the content-addressed store, hash-verified

400}
401
402async function getCommit(sha: string): Promise<CommitResponse> {
403 const githubApiUrl = trimTrailingSlashFromUrl(getInput('github-api-url'))
404 const url = `${githubApiUrl}/repos/${process.env.GITHUB_REPOSITORY}/commits/${sha}`
405 const res = await request(url)
406
407 if (typeof res != 'object' || !res)
408 throw new Error('Response data must be an object.')
409
410 return res as CommitResponse
411}
412
413function parseVersionLine(str: string) {
414 return (str.split('"') || []).map((s) => matchVersion(s)).find((e) => !!e)

Callers 1

checkDiffFunction · 0.70

Calls 3

getInputFunction · 0.85
trimTrailingSlashFromUrlFunction · 0.70
requestFunction · 0.70

Tested by

no test coverage detected