mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2025-04-20 08:50:16 +03:00
18 lines
545 B
TypeScript
18 lines
545 B
TypeScript
// Build the Nix args out of inputs from the Actions environment
|
|
export function makeNixCommandArgs(
|
|
nixOptions: string[],
|
|
flakeInputs: string[],
|
|
commitMessage: string,
|
|
): string[] {
|
|
const flakeInputFlags = flakeInputs.flatMap((input) => [
|
|
"--update-input",
|
|
input,
|
|
]);
|
|
|
|
const updateLockMechanism = flakeInputFlags.length === 0 ? "update" : "lock";
|
|
|
|
return nixOptions
|
|
.concat(["flake", updateLockMechanism])
|
|
.concat(flakeInputFlags)
|
|
.concat(["--commit-lock-file", "--commit-lockfile-summary", commitMessage]);
|
|
}
|