mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-05-24 21:55:04 +00:00
Compare commits
2 Commits
8a1d3cbf2e
...
8890d1f140
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8890d1f140 | ||
![]() |
b910b4801b |
@ -13,7 +13,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"@types/parse-github-url": "^1.0.3",
|
|
||||||
"verify-package-export": "^0.0.3"
|
"verify-package-export": "^0.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@ -22,7 +21,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@huakunshen/jsr-client": "^0.1.5",
|
"@huakunshen/jsr-client": "^0.1.5",
|
||||||
"@kksh/api": "workspace:*",
|
"@kksh/api": "workspace:*",
|
||||||
"@octokit/rest": "^21.1.0",
|
"@octokit/rest": "^21.1.0"
|
||||||
"parse-github-url": "^1.0.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
* TODO: move this module to another folder
|
* TODO: move this module to another folder
|
||||||
*/
|
*/
|
||||||
import { Octokit } from "@octokit/rest"
|
import { Octokit } from "@octokit/rest"
|
||||||
import gh from "parse-github-url"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a user is a public member of a GitHub organization
|
* Check if a user is a public member of a GitHub organization
|
||||||
@ -44,14 +43,14 @@ export function parseGitHubRepoFromUri(uri: string): {
|
|||||||
owner: string
|
owner: string
|
||||||
repo: string
|
repo: string
|
||||||
} {
|
} {
|
||||||
const ghUrl = gh(uri)
|
// check regex
|
||||||
if (!ghUrl) {
|
const regex = /https?:\/\/github\.com\/([^\/]+)\/([^\/]+)/
|
||||||
|
const match = uri.match(regex)
|
||||||
|
if (!match) {
|
||||||
throw new Error("Invalid GitHub repository URI")
|
throw new Error("Invalid GitHub repository URI")
|
||||||
}
|
}
|
||||||
if (!ghUrl.owner || !ghUrl.name) {
|
const [, owner, repo] = match
|
||||||
throw new Error("Invalid GitHub repository URI")
|
return { owner, repo }
|
||||||
}
|
|
||||||
return { owner: ghUrl.owner, repo: ghUrl.name }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
} = $props()
|
} = $props()
|
||||||
const workflowRunId = githubActionInvocationId.split("/").at(-3)
|
const workflowRunId = githubActionInvocationId.split("/").at(-3)
|
||||||
const workflowRunUrl = `https://github.com/${repoOwner}/${repoName}/actions/runs/${workflowRunId}/workflow`
|
const workflowRunUrl = `https://github.com/${repoOwner}/${repoName}/actions/runs/${workflowRunId}/workflow`
|
||||||
|
const giteaMirrorUrl = `https://gitea.kunkun.sh/kunkun-extensions-mirror/${repoOwner}-${repoName}`
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card.Root>
|
<Card.Root>
|
||||||
@ -60,12 +61,12 @@
|
|||||||
class="underline">Transparentcy log entry</a
|
class="underline">Transparentcy log entry</a
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<!-- <p class="flex flex-col text-sm sm:flex-row">
|
<p class="flex flex-col text-sm sm:flex-row">
|
||||||
<strong class="mt-2 inline-block w-28 md:mt-0">GitLab Mirror</strong>
|
<strong class="mt-2 inline-block w-28 md:mt-0">Mirror</strong>
|
||||||
<a href={gitlabMirrorUrl} target="_blank" rel="noreferrer" class="underline"
|
<a href={giteaMirrorUrl} target="_blank" rel="noreferrer" class="underline">
|
||||||
>GitLab Mirror</a
|
Mirror Repo
|
||||||
>
|
</a>
|
||||||
</p> -->
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card.Root>
|
</Card.Root>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user