Skip to content

Commit 8721d2a

Browse files
authored
fix: make ai model optional in github action (#82)
1 parent 7b6b678 commit 8721d2a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ For GitHub, you can use the official LGTM AI GitHub Action:
298298
with:
299299
ai-api-key: ${{ secrets.AI_API_KEY }}
300300
git-api-key: ${{ secrets.GITHUB_TOKEN }}
301+
model: 'gpt-5'
301302
pr-number: ${{ github.event.issue.number }}
302303
```
303304

action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ inputs:
2222
model:
2323
description: "AI model to use (e.g. gpt-4o, claude-3-5-sonnet-latest, gemini-2.0-flash)"
2424
required: false
25-
default: "gpt-5"
2625

2726
version:
2827
description: "LGTM AI version (latest, v0.7.2, etc.)"
@@ -61,10 +60,13 @@ runs:
6160
--pr-url "https://github.com/${{ github.repository }}/pull/${{ inputs.pr-number }}"
6261
--git-api-key "${{ inputs.git-api-key }}"
6362
--ai-api-key "${{ inputs.ai-api-key }}"
64-
--model "${{ inputs.model }}"
6563
)
6664
6765
# Optional flags
66+
if [ -n "${{ inputs.model }}" ]; then
67+
ARGS+=(--model "${{ inputs.model }}")
68+
fi
69+
6870
if [ "${{ inputs.publish }}" = "true" ]; then
6971
ARGS+=(--publish)
7072
fi

0 commit comments

Comments
 (0)