Skip to content

Commit

Permalink
escape double quotes in md reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Aug 13, 2024
1 parent a7708be commit 712a9a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ jobs:
rm $current_report
fi
else
echo "::warning::Failed to find new issues for $base_report using an LLM model, will use full report."
echo "::warning::Failed to generate a diff report with new issues for $base_report using an LLM model, will use full report."
fi
else
echo "::error::Failed to find current report for $base_report (file $current_file doesn't exist, but should have been generated). Please check Slither logs."
echo "::error::Failed to find current commit's equivalent of $base_report (file $current_file doesn't exist, but should have been generated). Please check Slither logs."
exit 1
fi
done
Expand Down
6 changes: 3 additions & 3 deletions contracts/scripts/ci/find_slither_report_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ else
validation_prompt_path=""
fi

first_report_content=$(cat "$first_report_path" | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
second_report_content=$(cat "$second_report_path" | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
first_report_content=$(cat "$first_report_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
second_report_content=$(cat "$second_report_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
openai_prompt=$(cat "$report_prompt_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
openai_model="gpt-4o"
openai_result=$(echo '{
Expand Down Expand Up @@ -57,7 +57,7 @@ echo "$new_issues_report_content" > "$new_issues_report_path"

if [[ -n "$validation_prompt_path" ]]; then
echo "::debug::Validating the diff report using the validation prompt"
report_input=$(echo "$new_issues_report_content" | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
report_input=$(echo "$new_issues_report_content" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
validation_prompt_content=$(cat "$validation_prompt_path" | sed 's/"/\\"/g' | sed -E 's/\\+$//g' | sed -E 's/\\+ //g')
validation_result=$(echo '{
"model": "'$openai_model'",
Expand Down

0 comments on commit 712a9a5

Please sign in to comment.