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

Method getLatestRelease

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

* Get the latest release from a repository

(owner: string, repo: string)

Source from the content-addressed store, hash-verified

249 * Get the latest release from a repository
250 */
251 async getLatestRelease(owner: string, repo: string): Promise<GitHubRelease> {
252 try {
253 const { data } = await this.octokit.repos.getLatestRelease({ owner, repo });
254 const parsed = GitHubReleaseSchema.safeParse(data);
255 if (!parsed.success) {
256 throw new GitHubClientError(`Invalid release info response: ${formatError(parsed.error)}`);
257 }
258 return parsed.data;
259 } catch (error) {
260 throw this.handleError(error);
261 }
262 }
263
264 /**
265 * Handle errors from Octokit and convert to GitHubClientError

Callers 1

checkForUpdateFunction · 0.95

Calls 2

handleErrorMethod · 0.95
formatErrorFunction · 0.85

Tested by

no test coverage detected