MCPcopy Create free account
hub / github.com/github/docs / getCommitSha

Function getCommitSha

script/helpers/git-utils.js:6–18  ·  view source on GitHub ↗
(owner, repo, ref)

Source from the content-addressed store, hash-verified

4
5// https://docs.github.com/rest/reference/git#get-a-reference
6export async function getCommitSha(owner, repo, ref) {
7 try {
8 const { data } = await github.git.getRef({
9 owner,
10 repo,
11 ref,
12 })
13 return data.object.sha
14 } catch (err) {
15 console.log('error getting tree')
16 throw err
17 }
18}
19
20// https://docs.github.com/rest/reference/git#list-matching-references
21export async function listMatchingRefs(owner, repo, ref) {

Callers 1

getTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected