Skip to content

Commit cdf4c68

Browse files
committed
fix(dashboard): throw if config path normalizes to empty in workflow yaml
Inputs like "./" pass the upstream non-empty trim check but normalize to "" inside buildWorkflowYaml, which would emit `paths: [""]` and an empty STACK_AUTH_CONFIG_PATH env var. Fail fast at the boundary instead of committing a silently broken workflow to the user's repo.
1 parent 08bbba5 commit cdf4c68

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/new-project/page-client-parts/link-existing-onboarding-workflow.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ export function normalizeConfigPath(configPath: string): string {
1616

1717
export function buildWorkflowYaml(branch: string, configPath: string): string {
1818
const encodedBranch = encodeYamlScalar(branch);
19-
const encodedConfigPath = encodeYamlScalar(normalizeConfigPath(configPath));
19+
const normalizedConfigPath = normalizeConfigPath(configPath);
20+
if (normalizedConfigPath.length === 0) {
21+
throw new Error("Expected a non-empty config path after normalization (input must not be blank or only './').");
22+
}
23+
const encodedConfigPath = encodeYamlScalar(normalizedConfigPath);
2024
const encodedWorkflowPath = encodeYamlScalar(WORKFLOW_FILE_PATH);
2125

2226
return `name: Stack Auth Config Sync

0 commit comments

Comments
 (0)