Skip to content

Commit db2184c

Browse files
committed
fix(scripts): strip any host prefix from repository in build scripts
Same fix as the hooks — sync-checksums.mjs and downloads.mjs hardcoded `github:` instead of stripping any `<host>:` prefix generically.
1 parent af5e32f commit db2184c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/cli/scripts/sea-build-utils/downloads.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,11 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
261261
// Filter by release === 'asset' to include all GitHub-released tools.
262262
for (const [toolName, toolConfig] of Object.entries(externalTools)) {
263263
if (toolConfig.release === 'asset') {
264-
const repoPath = toolConfig.repository.replace(/^github:/, '')
264+
const repoPath = toolConfig.repository.replace(/^[^:]+:/, '')
265265
const parts = repoPath.split('/')
266266
if (parts.length !== 2 || !parts[0] || !parts[1]) {
267267
throw new Error(
268-
`Invalid repository format for ${toolName}: expected 'github:owner/repo', got '${toolConfig.repository}'`,
268+
`Invalid repository format for ${toolName}: expected '<host>:owner/repo', got '${toolConfig.repository}'`,
269269
)
270270
}
271271
const [owner, repo] = parts
@@ -534,7 +534,7 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
534534
// socket_basics orchestrates the security tools (trivy, trufflehog, opengrep).
535535
const socketBasicsConfig = externalTools['socket-basics']
536536
if (socketBasicsConfig && socketBasicsConfig.release === 'archive') {
537-
const repoPath = socketBasicsConfig.repository.replace(/^github:/, '')
537+
const repoPath = socketBasicsConfig.repository.replace(/^[^:]+:/, '')
538538
const releaseVersion = socketBasicsConfig.version
539539
const version = releaseVersion.replace(/^v/, '') // Remove 'v' prefix for version
540540

packages/cli/scripts/sync-checksums.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async function main() {
216216
let failed = 0
217217

218218
for (const tool of githubTools) {
219-
const repoPath = tool.repository.replace(/^github:/, '')
219+
const repoPath = tool.repository.replace(/^[^:]+:/, '')
220220
const releaseTag = tool.tag ?? tool.version
221221
console.log(`[${tool.key}] ${repoPath} @ ${releaseTag}`)
222222

0 commit comments

Comments
 (0)