Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/hooks/setup-security-tools/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async function setupZizmor(): Promise<boolean> {
throw new Error(`Unsupported platform: ${platformKey}`)
}
const { asset, sha256: expectedSha } = platformEntry
const repo = ZIZMOR.repository?.replace(/^github:/, '') ?? ''
const repo = ZIZMOR.repository?.replace(/^[^:]+:/, '') ?? ''
const url = `https://github.com/${repo}/releases/download/v${ZIZMOR.version}/${asset}`

logger.log(`Downloading zizmor v${ZIZMOR.version} (${asset})...`)
Expand Down Expand Up @@ -184,7 +184,7 @@ async function setupSfw(apiKey: string | undefined): Promise<boolean> {

// Checksum + asset.
const { asset, sha256 } = platformEntry
const repo = sfwConfig.repository?.replace(/^github:/, '') ?? ''
const repo = sfwConfig.repository?.replace(/^[^:]+:/, '') ?? ''
const url = `https://github.com/${repo}/releases/download/${sfwConfig.version}/${asset}`
const binaryName = isEnterprise ? 'sfw' : 'sfw-free'

Expand Down
4 changes: 2 additions & 2 deletions .claude/hooks/setup-security-tools/update.mts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async function updateZizmor(config: Config): Promise<UpdateResult> {
return { tool, skipped: true, updated: false, reason: 'not in config' }
}

const repo = toolConfig.repository ?? 'zizmorcore/zizmor'
const repo = toolConfig.repository?.replace(/^[^:]+:/, '') ?? 'zizmorcore/zizmor'

let release: GhRelease
try {
Expand Down Expand Up @@ -265,7 +265,7 @@ async function updateSfwTool(
return { tool: toolName, skipped: true, updated: false, reason: 'not in config' }
}

const repo = toolConfig.repository
const repo = toolConfig.repository?.replace(/^[^:]+:/, '')
if (!repo) {
return { tool: toolName, skipped: true, updated: false, reason: 'no repository' }
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async function downloadAndVerify(tool, config) {
await rm(cachePath, { recursive: true, force: true })
}

const repo = config.repository.replace(/^github:/, '')
const repo = config.repository.replace(/^[^:]+:/, '')
const tmpDir = path.join(
getCacheDir(),
`.tmp-${tool}-${version}-${process.pid}`,
Expand Down