Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
executable file
·86 lines (83 loc) · 3.44 KB
/
Copy pathaction.yml
File metadata and controls
executable file
·86 lines (83 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: AI Code Review
description: >
Review a GitHub Pull Request or triage an Issue using any OpenAI-compatible
endpoint (e.g. a self-hosted vLLM reachable over HTTPS). Posts a structured
Markdown comment.
inputs:
vllm-url:
description: "Base URL of the vLLM server (e.g. http://<your-host>:30000/v1)"
required: true
github-token:
description: "GitHub token for fetching PR diff and posting the review comment"
required: true
vllm-model:
description: "Override model ID. Auto-detected from /v1/models if empty."
required: false
default: ""
vllm-timeout:
description: "Total request timeout in seconds"
required: false
default: "120"
vllm-retries:
description: "Number of retries on LLM request failure"
required: false
default: "2"
vllm-verify-max-tokens:
description: "Max tokens for the two-round verification call (final report generation)"
required: false
default: "8192"
vllm-api-key:
description: "API key for vLLM server authentication (optional, defaults to 'none')"
required: false
default: ""
target-type:
description: "Target kind: 'pr' or 'issue'"
required: false
default: "pr"
target-number:
description: "PR/issue number. Falls back to github.event.pull_request.number / github.event.issue.number"
required: false
default: ""
head-sha:
description: "PR head commit SHA (used for source context and PR-number fallback in workflow_run)"
required: false
default: ""
extra-headers:
description: "Extra HTTP headers sent with every vLLM request, one 'Name: Value' per line (e.g. gateway/auth headers)"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Download code-review-cli binary
shell: bash
run: |
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ASSET="code-review-cli-linux-amd64" ;;
aarch64) ASSET="code-review-cli-linux-arm64" ;;
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
esac
BASE_URL="https://github.com/WillIsback/code-review/releases/latest/download"
curl -fsSL -o "${{ github.action_path }}/code-review-cli" "${BASE_URL}/${ASSET}"
curl -fsSL -o "${{ github.action_path }}/code-review-cli.sha256" "${BASE_URL}/${ASSET}.sha256"
# Verify checksum (cd into the dir so sha256sum resolves the filename correctly)
sed -i "s|${ASSET}|code-review-cli|" "${{ github.action_path }}/code-review-cli.sha256"
(cd "${{ github.action_path }}" && sha256sum --check "code-review-cli.sha256")
chmod +x "${{ github.action_path }}/code-review-cli"
- name: Run AI Code Review
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
VLLM_BASE_URL: ${{ inputs.vllm-url }}
VLLM_MODEL: ${{ inputs.vllm-model }}
VLLM_TIMEOUT_SECS: ${{ inputs.vllm-timeout }}
VLLM_RETRIES: ${{ inputs.vllm-retries }}
VLLM_VERIFY_MAX_TOKENS: ${{ inputs.vllm-verify-max-tokens }}
VLLM_API_KEY: ${{ inputs.vllm-api-key }}
TARGET_TYPE: ${{ inputs.target-type }}
TARGET_NUMBER: ${{ inputs.target-number || github.event.pull_request.number || github.event.issue.number }}
HEAD_SHA: ${{ inputs.head-sha || github.event.pull_request.head.sha || github.event.workflow_run.head_sha }}
EXTRA_HEADERS: ${{ inputs.extra-headers }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: ${{ github.action_path }}/code-review-cli