MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / resolveRefToSha

Method resolveRefToSha

src/lib/github-client.ts:235–246  ·  view source on GitHub ↗

* Resolve a ref (branch, tag, or SHA) to a full commit SHA.

(owner: string, repo: string, ref: string)

Source from the content-addressed store, hash-verified

233 * Resolve a ref (branch, tag, or SHA) to a full commit SHA.
234 */
235 async resolveRefToSha(owner: string, repo: string, ref: string): Promise<string> {
236 try {
237 const { data } = await this.octokit.repos.getCommit({
238 owner,
239 repo,
240 ref,
241 });
242 return data.sha;
243 } catch (error) {
244 throw this.handleError(error);
245 }
246 }
247
248 /**
249 * Get the latest release from a repository

Callers 1

resolveGithubFetchRefFunction · 0.45

Calls 1

handleErrorMethod · 0.95

Tested by

no test coverage detected