filter default paths

This commit is contained in:
Ryan Cao 2023-07-19 10:41:57 +08:00
parent 58ea71f13c
commit 5f106d5966
No known key found for this signature in database

View file

@ -15,7 +15,15 @@ export const push = async () => {
core.info("Pushing to cache"); core.info("Pushing to cache");
const oldPaths = JSON.parse(core.getState("initial-paths")) as string[]; const oldPaths = JSON.parse(core.getState("initial-paths")) as string[];
const newPaths = await getStorePaths(); const newPaths = await getStorePaths();
const addedPaths = newPaths.filter((p) => !oldPaths.includes(p)); const addedPaths = newPaths
.filter((p) => !oldPaths.includes(p))
.filter(
(p) =>
!p.endsWith(".drv") &&
!p.endsWith(".drv.chroot") &&
!p.endsWith(".check") &&
!p.endsWith(".lock")
);
await exec("attic", ["push", cache, ...addedPaths]); await exec("attic", ["push", cache, ...addedPaths]);
} }