mirror of
https://github.com/hustcer/deepseek-review.git
synced 2026-05-13 05:16:05 +08:00
69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
# Deepseek Code Review Action
|
|
# @author: hustcer
|
|
# @created: 2025/01/29 13:05:20
|
|
# REF:
|
|
# - https://docs.github.com/cn/actions/creating-actions/about-custom-actions
|
|
# - https://docs.github.com/cn/actions/creating-actions/metadata-syntax-for-github-actions
|
|
# - https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
|
|
|
|
name: 'Deepseek Code Review'
|
|
author: 'hustcer'
|
|
description: 'A github action to do code review by Deepseek for PRs.'
|
|
|
|
branding:
|
|
icon: 'code'
|
|
color: 'purple'
|
|
|
|
inputs:
|
|
deepseek-token:
|
|
required: true
|
|
description: 'Your deepseek API token.'
|
|
model:
|
|
required: false
|
|
default: 'deepseek-chat'
|
|
description: 'The deepseek model to choose for code review.'
|
|
base-url:
|
|
required: false
|
|
default: 'https://api.deepseek.com'
|
|
description: 'The base url of deepseek API.'
|
|
sys-prompt:
|
|
required: false
|
|
default: 'You are a professional code review assistant responsible for analyzing code changes in GitHub Pull Requests. Identify potential issues such as code style violations, logical errors, security vulnerabilities, and provide improvement suggestions. Clearly list the problems and recommendations in a concise manner.'
|
|
description: 'The system prompt for deepseek API.'
|
|
user-prompt:
|
|
required: false
|
|
default: 'Please review the following code changes'
|
|
description: 'The user prompt for deepseek API.'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Setup Nu
|
|
uses: hustcer/setup-nu@v3
|
|
with:
|
|
version: 0.101.0
|
|
|
|
- name: Deepseek Code Review
|
|
shell: nu {0}
|
|
run: |
|
|
const NU_LIB_DIRS = [ ${{ github.action_path }}/nu ]
|
|
use review.nu *
|
|
let model = '${{inputs.model}}'
|
|
let baseUrl = '${{inputs.base-url}}'
|
|
let token = '${{inputs.deepseek-token}}'
|
|
let sysPrompt = '${{inputs.sys-prompt}}'
|
|
let userPrompt = '${{inputs.user-prompt}}'
|
|
let ghToken = '${{ github.token }}'
|
|
let repo = '${{ github.repository }}'
|
|
let pr = '${{ github.event.pull_request.number }}'
|
|
(deepseek-review $token
|
|
--model $model
|
|
--repo $repo
|
|
--pr-number $pr
|
|
--gh-token $ghToken
|
|
--base-url $baseUrl
|
|
--sys-prompt $sysPrompt
|
|
--user-prompt $userPrompt
|
|
)
|
|
|