Skip to content

Commit e23990b

Browse files
committedDec 21, 2024
debug
1 parent a2e37dd commit e23990b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎.forgejo/workflows/tofu-issue-deploy.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,18 @@ jobs:
1818
ISSUE_BODY="${{ github.event.issue.body }}"
1919
echo "ISSUE_BODY=$ISSUE_BODY"
2020
21+
# Check if 'VM Name' is in the body
22+
echo "$ISSUE_BODY" | grep 'VM Name' # This should print the line with 'VM Name'
23+
24+
# Extract the value for VM_NAME
2125
VM_NAME=$(echo "$ISSUE_BODY" | grep -A 1 'VM Name' | tail -n 1 | xargs)
22-
echo "VM_NAME=$VM_NAME"
26+
echo "Extracted VM_NAME: '$VM_NAME'" # Debugging extracted value
27+
28+
if [ -z "$VM_NAME" ]; then
29+
echo "Error: VM_NAME is empty. Check the formatting of the input."
30+
else
31+
echo "VM_NAME=$VM_NAME" # Display the value if extracted correctly
32+
fi
2333
2434
VM_ID=$(echo "$ISSUE_BODY" | grep 'VM ID:' | cut -d':' -f2 | xargs)
2535
RAM=$(echo "$ISSUE_BODY" | grep 'RAM:' | cut -d':' -f2 | xargs)

0 commit comments

Comments
 (0)
Please sign in to comment.