1 parent ca167e7 commit 332b839Copy full SHA for 332b839
1 file changed
.github/workflows/deploy.yaml
@@ -62,8 +62,16 @@ jobs:
62
- name: Is there a computer VM?
63
id: check
64
run: |
65
- n=$(ssh -i ~/.ssh/id_ed25519 exe.dev ls --l --json \
66
- | jq -r --arg tag "$VM_TAG" '[.vms[] | select((.tags // []) | index($tag))] | length')
+ if ! ssh -i ~/.ssh/id_ed25519 exe.dev ls --l --json > vms.json; then
+ echo "exe.dev VM listing failed"
67
+ exit 1
68
+ fi
69
+ if ! jq -e . vms.json >/dev/null; then
70
+ echo "exe.dev VM listing did not return JSON; raw output follows:"
71
+ sed -n '1,80p' vms.json
72
73
74
+ n=$(jq -r --arg tag "$VM_TAG" '[.vms[] | select((.tags // []) | index($tag))] | length' vms.json)
75
echo "found $n VM(s) tagged $VM_TAG"
76
if [ "$n" -gt 0 ]; then echo "exists=true"; else echo "exists=false"; fi >> "$GITHUB_OUTPUT"
77
0 commit comments