feat: Added nix option
fix: nix options position Use empty list fix options
This commit is contained in:
parent
bc75a5b55e
commit
b55ee105d9
|
@ -95,6 +95,10 @@ inputs:
|
|||
description: 'GPG Private Key Passphrase for the GPG Private Key with which to sign the commits in the PR to be created'
|
||||
required: false
|
||||
default: ''
|
||||
nix-options:
|
||||
description: 'A space-separated list of options to pass to the nix command'
|
||||
required: false
|
||||
default: ''
|
||||
outputs:
|
||||
pull-request-number:
|
||||
description: 'The number of the opened pull request'
|
||||
|
@ -146,6 +150,7 @@ runs:
|
|||
GIT_AUTHOR_EMAIL: ${{ env.GIT_AUTHOR_EMAIL }}
|
||||
GIT_COMMITTER_NAME: ${{ env.GIT_COMMITTER_NAME }}
|
||||
GIT_COMMITTER_EMAIL: ${{ env.GIT_COMMITTER_EMAIL }}
|
||||
NIX_OPTIONS: ${{ inputs.nix-options }}
|
||||
TARGETS: ${{ inputs.inputs }}
|
||||
COMMIT_MSG: ${{ inputs.commit-msg }}
|
||||
PATH_TO_FLAKE_DIR: ${{ inputs.path-to-flake-dir }}
|
||||
|
|
|
@ -5,12 +5,19 @@ if [[ -n "$PATH_TO_FLAKE_DIR" ]]; then
|
|||
cd "$PATH_TO_FLAKE_DIR"
|
||||
fi
|
||||
|
||||
options=()
|
||||
if [[ -n "$NIX_OPTIONS" ]]; then
|
||||
for option in $NIX_OPTIONS; do
|
||||
options+=("${option}")
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -n "$TARGETS" ]]; then
|
||||
inputs=()
|
||||
for input in $TARGETS; do
|
||||
inputs+=("--update-input" "$input")
|
||||
done
|
||||
nix flake lock "${inputs[@]}" --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
|
||||
nix "${options[@]}" flake lock "${inputs[@]}" --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
|
||||
else
|
||||
nix flake update --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
|
||||
nix "${options[@]}" flake update --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue