diff --git a/examples/third_party/Code_quality_and_security_scan_with_GitHub_Actions.md b/examples/third_party/Code_quality_and_security_scan_with_GitHub_Actions.md index 8cd8baf5f3..1a6ebd7354 100644 --- a/examples/third_party/Code_quality_and_security_scan_with_GitHub_Actions.md +++ b/examples/third_party/Code_quality_and_security_scan_with_GitHub_Actions.md @@ -98,6 +98,7 @@ jobs: if [ -f original_files_temp.json ]; then jq -s '.[0] * .[1]' diff.json original_files_temp.json > combined.json mv combined.json diff.json + fi - name: Display Processed Diff (Debug) run: cat diff.json @@ -105,12 +106,13 @@ jobs: - name: Analyze with OpenAI env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + MODELNAME: ${{ vars.MODELNAME }} run: | DIFF_CONTENT=$(jq -r '.diff' diff.json) ORIGINAL_FILES=$(jq -r '."original files"' diff.json) PROMPT="Please review the following code changes for any obvious quality or security issues. Provide a brief report in markdown format:\n\nDIFF:\n${DIFF_CONTENT}\n\nORIGINAL FILES:\n${ORIGINAL_FILES}" - jq -n --arg prompt "$PROMPT" '{ - "model": "gpt-4", + jq -n --arg model "$MODELNAME" --arg prompt "$PROMPT" '{ + "model": "\($model)", "messages": [ { "role": "system", "content": "You are a code reviewer." }, { "role": "user", "content": $prompt } @@ -257,4 +259,4 @@ Commit this workflow to your repository, then open a new PR. The workflow will r ![pr_quality_and_security_check.png](../../images/pr_quality_and_security_check.png) -![workflow_check.png](../../images/workflow_check.png) \ No newline at end of file +![workflow_check.png](../../images/workflow_check.png)