actions: style
This commit is contained in:
1 parent
d03a144566
commit
c0399df117
3 files changed
+5
-4
No files matched your search
@@ -40,7 +40,6 @@ runs:
|
|||||||
SOPS_AGE_KEY: ${{ inputs.sops-age-key }}
|
SOPS_AGE_KEY: ${{ inputs.sops-age-key }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
echo "searching for SOPS files to decrypt..."
|
echo "searching for SOPS files to decrypt..."
|
||||||
|
|
||||||
while IFS= read -r -d '' file; do
|
while IFS= read -r -d '' file; do
|
||||||
@@ -48,9 +47,7 @@ runs:
|
|||||||
output_file="$dir/${base/.sops/}"
|
output_file="$dir/${base/.sops/}"
|
||||||
|
|
||||||
echo "decrypting '$file' to '$output_file'"
|
echo "decrypting '$file' to '$output_file'"
|
||||||
|
|
||||||
tmp=$(mktemp "$dir/.sops-decrypt.XXXXXX")
|
tmp=$(mktemp "$dir/.sops-decrypt.XXXXXX")
|
||||||
|
|
||||||
if ! sops --decrypt "$file" > "$tmp" || [ ! -s "$tmp" ]; then
|
if ! sops --decrypt "$file" > "$tmp" || [ ! -s "$tmp" ]; then
|
||||||
echo "decryption of '$file' failed or produced empty output" >&2
|
echo "decryption of '$file' failed or produced empty output" >&2
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
@@ -60,5 +57,4 @@ runs:
|
|||||||
chmod 600 "$tmp"
|
chmod 600 "$tmp"
|
||||||
mv "$tmp" "$output_file"
|
mv "$tmp" "$output_file"
|
||||||
done < <(find . -type f -name "*.sops.*" -not -name ".sops.yaml" -print0)
|
done < <(find . -type f -name "*.sops.*" -not -name ".sops.yaml" -print0)
|
||||||
|
|
||||||
echo "SOPS decryption complete."
|
echo "SOPS decryption complete."
|
||||||
@@ -29,6 +29,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
command -v rsync >/dev/null && exit 0
|
command -v rsync >/dev/null && exit 0
|
||||||
|
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
sudo apt-get -yqq install rsync
|
sudo apt-get -yqq install rsync
|
||||||
|
|
||||||
@@ -41,8 +42,10 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
ssh-keyscan -p "$PORT" -H "$HOST" >> ~/.ssh/known_hosts
|
ssh-keyscan -p "$PORT" -H "$HOST" >> ~/.ssh/known_hosts
|
||||||
chmod 600 ~/.ssh/known_hosts
|
chmod 600 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
ssh-keyscan -p "$PORT" -H "$HOST" >> ~/.ssh/known_hosts
|
ssh-keyscan -p "$PORT" -H "$HOST" >> ~/.ssh/known_hosts
|
||||||
chmod 600 ~/.ssh/known_hosts
|
chmod 600 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user