ci: Double-quote variables in GitHub Actions

This is best practice for shell scripts.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
Demi Marie Obenour
2026-04-09 13:00:24 -04:00
committed by Bo Chen
parent 9d47769bc2
commit 23e139c0f8
5 changed files with 31 additions and 33 deletions

View File

@@ -38,7 +38,7 @@ jobs:
run: |
set -e
echo "Connecting to the VM via SSH..."
ssh -i ~/.ssh/${KEY} -o StrictHostKeyChecking=no ${USERNAME}@${PRIVATE_IP} << EOF
ssh -i ~/.ssh/"${KEY}" -o StrictHostKeyChecking=no -- "${USERNAME}@${PRIVATE_IP}" << EOF
set -e
echo "Logged in successfully."
export PATH="\$HOME/.cargo/bin:\$PATH"
@@ -87,9 +87,7 @@ jobs:
PRIVATE_IP: ${{ needs.infra-setup.outputs.PRIVATE_IP }}
USERNAME: ${{ secrets.MSHV_USERNAME }}
run: |
ssh -i ~/.ssh/${KEY} -o StrictHostKeyChecking=no ${USERNAME}@${PRIVATE_IP} << EOF
sudo dmesg
EOF
ssh -i ~/.ssh/"${KEY}" -o StrictHostKeyChecking=no -- "${USERNAME}@${PRIVATE_IP}" sudo dmesg
- name: Dump serial console logs
if: always()
@@ -111,8 +109,8 @@ jobs:
env:
RG: MSHV-INTEGRATION-${{ github.run_id }}
run: |
if az group exists --name ${RG}; then
az group delete --name ${RG} --yes --no-wait
if az group exists --name "${RG}"; then
az group delete --name "${RG}" --yes --no-wait
else
echo "Resource Group ${RG} does not exist. Skipping deletion."
fi
@@ -122,8 +120,8 @@ jobs:
env:
KEY: azure_key_${{ github.run_id }}
run: |
if [ -f ~/.ssh/${KEY} ]; then
rm -f ~/.ssh/${KEY} ~/.ssh/${KEY}.pub
if [ -f ~/.ssh/"${KEY}" ]; then
rm -f ~/.ssh/"${KEY}" ~/.ssh/"${KEY}.pub"
echo "SSH key deleted successfully."
else
echo "SSH key does not exist. Skipping deletion."