Skip to content

Commit

Permalink
Store openai report into the report_output.md file
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Pellitteri <[email protected]>
  • Loading branch information
AlbertoPellitteri authored and poiana committed Dec 11, 2024
1 parent 1a9c216 commit 3950d6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions analyze/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,17 @@ runs:
# If OpenAI API key is set, create a brief summary using OpenAI
if ${{ env.OPENAI_API_KEY != '' }}; then
echo "Creating Report Summary using OpenAI"
echo "# Report Summary" >> $GITHUB_STEP_SUMMARY
echo "# Report Summary" >> /tmp/report_openai.md
echo "Installing python dependencies"
python3 -m pip install -r ${{github.action_path}}/src/integrations/openai/requirements.txt
echo "Calling OpenAI APIs for summary"
if ${{inputs.openai-user-prompt == ''}}; then
python3 ${{github.action_path}}/src/integrations/openai/create_summary.py /tmp/report_output.md --model "${{inputs.openai-model}}" >> $GITHUB_STEP_SUMMARY
python3 ${{github.action_path}}/src/integrations/openai/create_summary.py /tmp/report_output.md --model "${{inputs.openai-model}}" >> /tmp/report_openai.md
else
python3 ${{github.action_path}}/src/integrations/openai/create_summary.py /tmp/report_output.md --model "${{inputs.openai-model}}" --user_input "${{inputs.openai-user-prompt}}" >> $GITHUB_STEP_SUMMARY
python3 ${{github.action_path}}/src/integrations/openai/create_summary.py /tmp/report_output.md --model "${{inputs.openai-model}}" --user_input "${{inputs.openai-user-prompt}}" >> /tmp/report_openai.md
fi
cat /tmp/report_output.md >> /tmp/report_openai.md
mv /tmp/report_openai.md /tmp/report_output.md
fi
echo "Appending report to github summary"
Expand Down

0 comments on commit 3950d6e

Please sign in to comment.