Allow consumers to update specific flake inputs
This commit is contained in:
parent
8145cc6e00
commit
0f6e7d684e
|
@ -1,9 +1,14 @@
|
||||||
name: 'Update flake.lock'
|
name: 'Update flake.lock'
|
||||||
description: 'Update your flake.lock and send a PR'
|
description: 'Update your flake.lock and send a PR'
|
||||||
|
inputs:
|
||||||
|
inputs:
|
||||||
|
description: 'A space-separated list of inputs to update. Leave empty to update all inputs.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: nix flake update --commit-lock-file
|
- run: ./update-input-or-inputs.sh ${{ inputs.inputs }}
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GIT_AUTHOR_NAME: github-actions[bot]
|
GIT_AUTHOR_NAME: github-actions[bot]
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
to_update=$*
|
||||||
|
|
||||||
|
if [ -n "$to_update" ]; then
|
||||||
|
inputs=()
|
||||||
|
for input in $to_update; do
|
||||||
|
inputs+=("--update-input" "$input")
|
||||||
|
done
|
||||||
|
nix flake lock "${inputs[@]}" --commit-lock-file
|
||||||
|
else
|
||||||
|
nix flake update --commit-lock-file
|
||||||
|
fi
|
Loading…
Reference in New Issue