mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
clean error outputs
On error, just mark the error with `core.setFailed`, this is enough to kill the process. Replace child_process.execFileSync with '@actions/exec'.exec to be async all the way.
This commit is contained in:
parent
6e4751ed42
commit
f22d9c7a0f
2 changed files with 6 additions and 12 deletions
|
|
@ -1,5 +1,4 @@
|
|||
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';
|
||||
|
||||
|
|
@ -48,25 +47,23 @@ async function setup() {
|
|||
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > /tmp/store-path-pre-build`]);
|
||||
} catch (error) {
|
||||
core.setFailed(`Action failed with error: ${error}`);
|
||||
throw (error);
|
||||
}
|
||||
}
|
||||
|
||||
async function upload() {
|
||||
core.startGroup('Cachix: upload');
|
||||
try {
|
||||
if (skipPush === 'true') {
|
||||
core.info('Pushing is disabled as skipPush is set to true');
|
||||
} else if (signingKey !== "" || authToken !== "") {
|
||||
core.startGroup('Cachix: pushing paths');
|
||||
execFileSync(`${__dirname}/push-paths.sh`, [cachixExecutable, name], { stdio: 'inherit' });
|
||||
core.endGroup();
|
||||
await exec.exec(`${__dirname}/push-paths.sh`, [cachixExecutable, name]);
|
||||
} else {
|
||||
core.info('Pushing is disabled as signing key nor auth token are set.');
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(`Action failed with error: ${error}`);
|
||||
throw (error);
|
||||
}
|
||||
core.endGroup();
|
||||
}
|
||||
|
||||
// Main
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue