Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make consistent report file when OpenAI summary is requested #34

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading