Skip to content
Open
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
7 changes: 4 additions & 3 deletions packages/server/src/routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
checkForUpdate,
BUNDLED_IS_BINARY,
BUNDLED_VERSION,
parseOwnerRepo,
} from '@archon/paths';
import { discoverWorkflowsWithConfig } from '@archon/workflows/workflow-discovery';
import { parseWorkflow } from '@archon/workflows/loader';
Expand Down Expand Up @@ -2402,12 +2403,12 @@ export function registerApiRoutes(
getLog().error({ runId, codebaseId: run.codebase_id }, 'artifacts.codebase_lookup_failed');
return apiError(c, 404, 'Artifact not available: codebase not found');
}
const nameParts = codebase.name.split('/');
if (nameParts.length < 2) {
const parsed = parseOwnerRepo(codebase.name);
if (!parsed) {
getLog().error({ runId, codebaseName: codebase.name }, 'artifacts.owner_repo_parse_failed');
return apiError(c, 404, 'Artifact not available: could not determine owner/repo');
}
const [owner, repo] = nameParts;
const { owner, repo } = parsed;

const artifactDir = getRunArtifactsPath(owner, repo, runId);
const filePath = join(artifactDir, filename);
Expand Down