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:
Domen Kožar 2020-05-12 10:13:15 +02:00
commit 13e2cf25a1
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
3 changed files with 8 additions and 2 deletions

View file

@ -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) {