Enhancement: Fail CI key removal when the key is not found #96
@@ -472,6 +472,7 @@ const revokeCiKeyScript = `set -euo pipefail
|
|||||||
IFS= read -r KEY || true
|
IFS= read -r KEY || true
|
||||||
[ -n "$KEY" ]
|
[ -n "$KEY" ]
|
||||||
f="$HOME/.ssh/authorized_keys"
|
f="$HOME/.ssh/authorized_keys"
|
||||||
|
grep -qxF -- "$KEY" "$f"
|
||||||
grep -vxF -- "$KEY" "$f" > "$f.new" || [ $? -eq 1 ]
|
grep -vxF -- "$KEY" "$f" > "$f.new" || [ $? -eq 1 ]
|
||||||
[ -s "$f.new" ]
|
[ -s "$f.new" ]
|
||||||
chmod 600 "$f.new"
|
chmod 600 "$f.new"
|
||||||
|
|||||||
Reference in new issue
Block a user