Prefer age for release secret decrypt
This commit is contained in:
parent
83da429854
commit
ef7023f9be
3 changed files with 16 additions and 1 deletions
|
|
@ -71,6 +71,11 @@ runs:
|
|||
nix_bin="$(resolve_nix_bin || true)"
|
||||
if [[ -n "$nix_bin" ]]; then
|
||||
local built
|
||||
built="$("$nix_bin" --extra-experimental-features 'nix-command flakes' build --no-link "$ROOT#age" --print-out-paths 2>/dev/null | tail -n 1 || true)"
|
||||
if [[ -n "$built" && -x "$built/bin/age" ]]; then
|
||||
printf 'age:%s\n' "$built/bin/age"
|
||||
return 0
|
||||
fi
|
||||
built="$("$nix_bin" --extra-experimental-features 'nix-command flakes' build --no-link "$ROOT#agenix" --print-out-paths 2>/dev/null | tail -n 1 || true)"
|
||||
if [[ -n "$built" && -x "$built/bin/agenix" ]]; then
|
||||
printf 'agenix:%s\n' "$built/bin/agenix"
|
||||
|
|
@ -93,7 +98,11 @@ runs:
|
|||
decrypt_age_file() {
|
||||
local file_path="$1"
|
||||
if [[ "$decrypt_kind" == "agenix" ]]; then
|
||||
"$decrypt_bin" --identity "$KEY" --decrypt "$file_path"
|
||||
local agenix_path="$file_path"
|
||||
if [[ "$file_path" == "$ROOT/"* ]]; then
|
||||
agenix_path="${file_path#"$ROOT"/}"
|
||||
fi
|
||||
(cd "$ROOT" && "$decrypt_bin" --identity "$KEY" --decrypt "$agenix_path")
|
||||
else
|
||||
"$decrypt_bin" --decrypt -i "$KEY" "$file_path"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue