-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
569 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import axios from 'axios' | ||
import { GithubRelease } from '../types/types' | ||
|
||
export async function getReleases(repoUrl: string): Promise<GithubRelease[]> { | ||
try { | ||
// Extract the owner and repo from the URL | ||
const repoMatch = repoUrl.match(/github\.com\/([^/]+)\/([^/]+)/) | ||
if (!repoMatch) { | ||
throw new Error('Invalid GitHub repository URL') | ||
} | ||
|
||
const owner = repoMatch[1] | ||
const repo = repoMatch[2] | ||
|
||
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/releases` | ||
const response = await axios.get(apiUrl) | ||
|
||
return response.data | ||
} catch (error) { | ||
console.error('Error fetching releases:', error) | ||
throw error | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
export interface GithubRelease { | ||
url: string | ||
assets_url: string | ||
upload_url: string | ||
html_url: string | ||
id: number | ||
author: { | ||
login: string | ||
id: number | ||
node_id: string | ||
avatar_url: string | ||
gravatar_id: string | ||
url: string | ||
html_url: string | ||
followers_url: string | ||
following_url: string | ||
gists_url: string | ||
starred_url: string | ||
subscriptions_url: string | ||
organizations_url: string | ||
repos_url: string | ||
events_url: string | ||
received_events_url: string | ||
type: string | ||
site_admin: boolean | ||
} | ||
node_id: string | ||
tag_name: string | ||
target_commitish: string | ||
name: string | ||
draft: boolean | ||
prerelease: boolean | ||
created_at: string | ||
published_at: string | ||
assets: Array<{ | ||
url: string | ||
id: number | ||
node_id: string | ||
name: string | ||
label: string | ||
uploader: { | ||
login: string | ||
id: number | ||
node_id: string | ||
avatar_url: string | ||
gravatar_id: string | ||
url: string | ||
html_url: string | ||
followers_url: string | ||
following_url: string | ||
gists_url: string | ||
starred_url: string | ||
subscriptions_url: string | ||
organizations_url: string | ||
repos_url: string | ||
events_url: string | ||
received_events_url: string | ||
type: string | ||
site_admin: boolean | ||
} | ||
content_type: string | ||
state: string | ||
size: number | ||
download_count: number | ||
created_at: string | ||
updated_at: string | ||
browser_download_url: string | ||
}> | ||
tarball_url: string | ||
zipball_url: string | ||
body: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.