@catladder/pipeline
Version:
Panter workflow for cloud CI/CD and DevOps
15 lines (13 loc) • 444 B
text/typescript
import type { CacheConfigAdvanced } from "..";
import type { CatladderJobCache } from "../../types/jobs";
import { ensureArray } from "../../utils";
export function transformLegacyJobCache(
jobCache: CatladderJobCache | CatladderJobCache[] | undefined,
): CacheConfigAdvanced[] {
return ensureArray(jobCache).map((cache) => ({
pathMode: "absolute",
...cache,
key: cache.key ?? "default",
paths: cache.paths ?? [],
}));
}