mirror of
https://github.com/hustcer/deepseek-review.git
synced 2026-05-13 05:16:05 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00000006fb | ||
|
|
1c83969b7b | ||
|
|
609f212d2b |
4
.github/workflows/cr.yml
vendored
4
.github/workflows/cr.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
- opened # Triggers when a PR is opened
|
||||
- reopened # Triggers when a PR is reopened
|
||||
- synchronize # Triggers when a commit is pushed to the PR
|
||||
# - labeled # Triggers when a label is added to the PR
|
||||
# - labeled # Triggers when a label is added to the PR
|
||||
|
||||
# fix: GraphQL: Resource not accessible by integration (addComment) error
|
||||
permissions:
|
||||
@@ -16,7 +16,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
setup-deepseek-review:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-latest
|
||||
name: Code Review
|
||||
# Make sure the code review happens only when the PR has the label 'ai review'
|
||||
# if: contains(github.event.pull_request.labels.*.name, 'ai review')
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [1.5.1] - 2025-02-01
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix `awk` error on `macOS` runner (#71)
|
||||
|
||||
## [1.5.0] - 2025-02-01
|
||||
|
||||
### Documentation
|
||||
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
</details>
|
||||
|
||||
When a PR is created, Deepseek code review will be automatically triggered, and the review results(depend on your prompt) will be posted as comments on the corresponding PR. For example:
|
||||
- [Example 1](https://github.com/hustcer/deepseek-review/pull/30) with default prompt & [Run Log](https://github.com/hustcer/deepseek-review/actions/runs/13043609677/job/36390331791#step:2:53).
|
||||
- [Example 1](https://github.com/hustcer/deepseek-review/pull/30) with [default prompts](https://github.com/hustcer/deepseek-review/blob/main/action.yaml#L35) & [Run Log](https://github.com/hustcer/deepseek-review/actions/runs/13043609677/job/36390331791#step:2:53).
|
||||
- [Example 2](https://github.com/hustcer/deepseek-review/pull/68) with [this prompt](https://github.com/hustcer/deepseek-review/blob/eba892d969049caff00b51a31e5c093aeeb536e3/.github/workflows/cr.yml#L32)
|
||||
|
||||
### Trigger CR When a Specific Label was Added
|
||||
|
||||
@@ -60,8 +60,8 @@ jobs:
|
||||
</details>
|
||||
|
||||
当 PR 创建的时候会自动触发 Deepseek 代码审查,并将审查结果(依赖于提示词)以评论的方式发布到对应的 PR 上。比如:
|
||||
- [示例 1](https://github.com/hustcer/deepseek-review/pull/30) 基于默认提示词 & [运行日志](https://github.com/hustcer/deepseek-review/actions/runs/13043609677/job/36390331791#step:2:53).
|
||||
- [示例 2](https://github.com/hustcer/deepseek-review/pull/68) 基于 [这个提示词](https://github.com/hustcer/deepseek-review/blob/eba892d969049caff00b51a31e5c093aeeb536e3/.github/workflows/cr.yml#L32)
|
||||
- [示例 1](https://github.com/hustcer/deepseek-review/pull/30) 基于[默认提示词](https://github.com/hustcer/deepseek-review/blob/main/action.yaml#L35) & [运行日志](https://github.com/hustcer/deepseek-review/actions/runs/13043609677/job/36390331791#step:2:53).
|
||||
- [示例 2](https://github.com/hustcer/deepseek-review/pull/68) 基于[这个提示词](https://github.com/hustcer/deepseek-review/blob/eba892d969049caff00b51a31e5c093aeeb536e3/.github/workflows/cr.yml#L32)
|
||||
|
||||
### 当 PR 添加指定 Label 时触发审查
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "deepseek-review",
|
||||
"version": "1.5.0",
|
||||
"actionVer": "v1.5",
|
||||
"version": "1.5.1",
|
||||
"actionVer": "v1.5.1",
|
||||
"author": "hustcer",
|
||||
"license": "MIT",
|
||||
"github": "https://github.com/hustcer/deepseek-review",
|
||||
|
||||
18
nu/review.nu
18
nu/review.nu
@@ -196,17 +196,31 @@ export def get-diff [
|
||||
if ($content | is-empty) {
|
||||
print $'(ansi g)Nothing to review.(ansi reset)'; exit $ECODE.SUCCESS
|
||||
}
|
||||
let awk_bin = (prepare-awk)
|
||||
if ($include | is-not-empty) {
|
||||
let patterns = $include | split row ','
|
||||
$content = $content | awk (generate-include-regex $patterns)
|
||||
$content = $content | ^$awk_bin (generate-include-regex $patterns)
|
||||
}
|
||||
if ($exclude | is-not-empty) {
|
||||
let patterns = $exclude | split row ','
|
||||
$content = $content | awk (generate-exclude-regex $patterns)
|
||||
$content = $content | ^$awk_bin (generate-exclude-regex $patterns)
|
||||
}
|
||||
$content
|
||||
}
|
||||
|
||||
# Prepare gawk for macOS
|
||||
export def prepare-awk [] {
|
||||
if (is-installed awk) {
|
||||
print $'Current awk version: (awk --version | lines | first)'
|
||||
}
|
||||
if ($env.GITHUB_ACTIONS? != 'true') { return 'awk' }
|
||||
if (sys host | get name) == 'Darwin' {
|
||||
brew install gawk
|
||||
print $'Current gawk version: (gawk --version | lines | first)'
|
||||
}
|
||||
'gawk'
|
||||
}
|
||||
|
||||
# Compact the record by removing empty columns
|
||||
export def compact-record []: record -> record {
|
||||
let record = $in
|
||||
|
||||
Reference in New Issue
Block a user