Skip to content

Commit 7d151bb

Browse files
committed
feat: push paths via stdin (closes #27)
1 parent cdb11a7 commit 7d151bb

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
"dependencies": {
1212
"@actions/core": "^1.11.1",
1313
"@actions/exec": "^1.1.1",
14-
"@actions/io": "^1.1.3",
15-
"just-split": "^3.2.0"
14+
"@actions/io": "^1.1.3"
1615
},
1716
"devDependencies": {
1817
"@types/node": "^20.16.10",
1918
"esbuild": "^0.24.0",
2019
"prettier": "3.3.3",
21-
"typescript": "^5.6.2"
20+
"typescript": "^5.6.3"
2221
},
23-
"packageManager": "[email protected].0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca"
22+
"packageManager": "[email protected].1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4"
2423
}

pnpm-lock.yaml

Lines changed: 5 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/stages/push.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as core from "@actions/core";
22
import { exec } from "@actions/exec";
33

4-
import split from "just-split";
54
import { saveStorePaths, getStorePaths } from "../utils";
65

76
export const push = async () => {
@@ -26,16 +25,9 @@ export const push = async () => {
2625
(p) => !p.endsWith(".drv") && !p.endsWith(".drv.chroot") && !p.endsWith(".check") && !p.endsWith(".lock"),
2726
);
2827

29-
const splitAddedPaths = split(addedPaths, 25);
30-
for (const addedPaths of splitAddedPaths) {
31-
await exec("attic", ["push", cache, ...addedPaths]);
32-
}
33-
34-
// https://github.com/zhaofengli/attic/pull/176
35-
36-
// await exec("attic", ["push", cache, "--stdin"], {
37-
// input: Buffer.from(addedPaths.join("\n")),
38-
// });
28+
await exec("attic", ["push", "--stdin", cache], {
29+
input: Buffer.from(addedPaths.join("\n")),
30+
});
3931
}
4032
} catch (e) {
4133
core.warning(`Action encountered error: ${e}`);

0 commit comments

Comments
 (0)