mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
Don't try to push store paths that were GCed
Previously we'd only push unique paths before/after the job, but that's not good enough because someone might run garbage collection. Now we only push unique store paths that are in the list of when the job finished.
This commit is contained in:
parent
490a246fbc
commit
13e2cf25a1
3 changed files with 8 additions and 2 deletions
3
dist/main/index.js
vendored
3
dist/main/index.js
vendored
|
|
@ -971,6 +971,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const child_process_1 = __webpack_require__(129);
|
||||
const coreCommand = __importStar(__webpack_require__(431));
|
||||
const exec = __importStar(__webpack_require__(986));
|
||||
exports.IsPost = !!process.env['STATE_isPost'];
|
||||
|
|
@ -1010,7 +1011,7 @@ function upload() {
|
|||
try {
|
||||
if (signingKey !== "" && skipPush !== 'true') {
|
||||
core.startGroup('Cachix: pushing paths');
|
||||
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - /tmp/store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
|
||||
child_process_1.execFileSync(`${__dirname}/push-paths.sh`, { stdio: 'inherit' });
|
||||
core.endGroup();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
dist/main/push-paths.sh
vendored
Executable file
4
dist/main/push-paths.sh
vendored
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
comm -13 <(sort /tmp/store-path-pre-build) <(nix path-info --all | grep -v '\.drv$') | $1 push $2
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import * as core from '@actions/core';
|
||||
import { execFileSync } from 'child_process';
|
||||
import * as coreCommand from '@actions/core/lib/command'
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ async function upload() {
|
|||
try {
|
||||
if (signingKey !== "" && skipPush !== 'true') {
|
||||
core.startGroup('Cachix: pushing paths');
|
||||
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - /tmp/store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
|
||||
execFileSync(`${__dirname}/push-paths.sh`, [cachixExecutable, name], { stdio: 'inherit' });
|
||||
core.endGroup();
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue