Skip to content

Commit

Permalink
add echo statements to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushi-agrawal-gladstone authored Oct 1, 2024
1 parent a51b2b8 commit 5d5b0a9
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/1_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,11 @@ jobs:
# Use while loop to iterate through deleted nodes safely
while IFS= read -r deleted_node; do
echo "Inside the while loop"
if [ -n "$deleted_node" ]; then
graph_id=$(echo "$deleted_node" | grep -o 'GraphId="[^"]*"' | sed 's/GraphId="//;s/"//')
echo "Graph id is: "
echo "$graph_id"
# Check if the same GraphId exists in the added/modified nodes
matching_added_node=$(echo "$added_or_modified_nodes" | grep "GraphId=\"$graph_id\"")
Expand All @@ -904,10 +907,14 @@ jobs:
fi
fi
done <<< "$deleted_nodes"
# Remove modified nodes from the deleted nodes list
actual_deleted_nodes=$(echo "$deleted_nodes" | grep -v -f <(echo "$modified_nodes"))

echo "Exit from the while loop"
# Remove modified nodes from the deleted nodes list (avoid using subshell for `grep -f`)
actual_deleted_nodes=$(echo "$deleted_nodes" | grep -vF "$(echo "$modified_nodes" | sed '/^$/d')")
echo "Actually deleted nodes:"
echo "$actual_deleted_nodes"
# Output the results
if [ -z "$actual_deleted_nodes" ] && [ -z "$modified_nodes" ]; then
echo "No nodes were deleted or modified."
Expand All @@ -924,9 +931,10 @@ jobs:
echo "Note: Review required for modified nodes."
fi
fi

# Store the deleted nodes as an environment variable for later use
echo "deleted_nodes=$deleted_nodes" >> $GITHUB_ENV
# Safely store the deleted nodes as an environment variable for later use
echo "deleted_nodes=${deleted_nodes}" >> $GITHUB_ENV
- name: Report on testing
Expand Down

0 comments on commit 5d5b0a9

Please sign in to comment.