Add nixBuildArgs parameter

This commit is contained in:
Tobias Happ 2020-01-05 19:52:08 +01:00 committed by Domen Kožar
commit a03feca499
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
5 changed files with 29 additions and 6 deletions

View file

@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import {type} from 'os';
import {prependEach, nonEmptySplit} from './strings';
import { type } from 'os';
import { prependEach, nonEmptySplit } from './strings';
function home() {
if (type() == "Darwin") {
@ -17,6 +17,7 @@ async function run() {
const file = core.getInput('file');
const skipNixBuild = core.getInput('skipNixBuild');
const attributes = core.getInput('attributes');
const nixBuildArgs = core.getInput('nixBuildArgs');
const name = core.getInput('name', { required: true });
const signingKey = core.getInput('signingKey');
const authToken = core.getInput('authToken')
@ -71,13 +72,14 @@ async function run() {
}
};
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
await exec.exec('nix-build', args, options);
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
await exec.exec('nix-build', additionalArgs.concat(args), options);
core.endGroup()
}
} catch (error) {
core.setFailed(`Action failed with error: ${error}`);
throw(error);
}
throw (error);
}
}
run();