Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ not contain review logic.

## Usage

GitHub Actions:

```yaml
name: Postil review

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
pull-requests: write

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: postil-dev/postil-reviewer@main
with:
api-key: ${{ secrets.OPENROUTER_API_KEY }}
```

The Action installs the `postil` binary from this repository revision, then runs
`postil review` against the pull request.

Local CLI:

```bash
postil review --repo owner/repo --pr 123 --sha HEAD_SHA
```
Expand Down
63 changes: 63 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 'Postil AI Review'
description: 'AI pull-request reviewer for serious teams, open-source, zero-infra, fully auditable.'
author: 'Postil'
branding:
icon: 'git-pull-request'
color: 'blue'

inputs:
api-key:
description: 'OpenRouter API key'
required: true
model:
description: 'OpenRouter model name'
required: false
default: 'moonshotai/kimi-k2.6'
fail-on:
description: 'Exit 1 when a finding meets this severity: info, warn, or error'
required: false
default: 'error'
no-inline:
description: 'Skip posting inline PR review comments'
required: false
default: 'false'
config-path:
description: 'Optional path to a configuration file'
required: false
github-token:
description: 'GitHub token for posting review comments'
required: false
default: '${{ github.token }}'

runs:
using: 'composite'
steps:
- name: Install Postil reviewer
shell: bash
run: cargo install --path "$GITHUB_ACTION_PATH" --locked --force
- name: Run Postil review
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
OPENROUTER_API_KEY: ${{ inputs.api-key }}
REVIEW_MODEL: ${{ inputs.model }}
POSTIL_FAIL_ON: ${{ inputs.fail-on }}
POSTIL_CONFIG_PATH: ${{ inputs.config-path }}
POSTIL_NO_INLINE: ${{ inputs.no-inline }}
run: |
args=(review)
if [[ -n "$POSTIL_CONFIG_PATH" ]]; then
args+=(--config "$POSTIL_CONFIG_PATH")
fi
case "$POSTIL_NO_INLINE" in
true)
args+=(--no-inline)
;;
false|"")
;;
*)
echo "::error::no-inline must be 'true' or 'false'"
exit 1
;;
esac
postil "${args[@]}"
Loading