Skip to content

Commit c59506b

Browse files
committed
docs: add more docs to readme
1 parent 384e046 commit c59506b

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ GitHub Action to run [lgtm-ai](https://github.com/elementsinteractive/lgtm-ai).
44

55
This action can be used to perform automatic code-reviews or write reviewer guides using LLMs, thanks to lgtm-ai.
66

7-
87
## Usage
98

109
| Input | Description | Required | Default |
@@ -19,6 +18,7 @@ This action can be used to perform automatic code-reviews or write reviewer guid
1918
| `config` | Path to lgtm.toml configuration file (e.g. '.lgtm.toml') || `""` (none) |
2019
| `verbose` | Enable extra verbose output (-vv instead of -v) || `false` |
2120

21+
### Quick Usage
2222

2323
```yaml
2424
- name: AI Code Review
@@ -28,4 +28,39 @@ This action can be used to perform automatic code-reviews or write reviewer guid
2828
git-api-key: ${{ secrets.GITHUB_TOKEN }}
2929
model: 'gpt-5'
3030
pr-number: ${{ github.event.issue.number }}
31-
```
31+
```
32+
33+
### Full Workflow Example
34+
35+
```yaml
36+
name: LGTM Review
37+
38+
on:
39+
issue_comment:
40+
types: [created]
41+
42+
jobs:
43+
lgtm-review:
44+
needs: check-permission
45+
if: |
46+
github.event.issue.pull_request &&
47+
startsWith(github.event.comment.body, '/lgtm review')
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout PR code
51+
uses: actions/checkout@v4
52+
with:
53+
ref: refs/pull/${{ github.event.issue.number }}/merge
54+
55+
- name: Run LGTM Review
56+
uses: ./
57+
with:
58+
ai-api-key: ${{ secrets.AI_API_TOKEN }}
59+
git-api-key: ${{ secrets.GITHUB_TOKEN }}
60+
pr-number: ${{ github.event.issue.number }}
61+
model: 'gpt-5'
62+
```
63+
64+
> [!TIP]
65+
> The action will autodiscover any `lgtm.toml` file in your repository so you can
66+
> fully configure `lgtm-ai`. See the [configuration documentation](https://github.com/elementsinteractive/lgtm-ai?tab=readme-ov-file#configuration-file).

0 commit comments

Comments
 (0)