Skip to content

Commit 2a21fbe

Browse files
committed
feat: 配置qoder工作流
1 parent 9cc644c commit 2a21fbe

3 files changed

Lines changed: 119 additions & 0 deletions

File tree

.github/workflows/assistant.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Qoder Assistant
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
9+
jobs:
10+
qoder-assistant:
11+
if: |
12+
contains(github.event.comment.body, '@qoder') &&
13+
!endsWith(github.event.comment.user.login, '[bot]')
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
issues: write
18+
pull-requests: write
19+
id-token: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Build Arguments
28+
id: build_args
29+
run: |
30+
ARGS="REPO: ${{ github.repository }}
31+
REQUEST_SOURCE: ${{ github.event_name }}
32+
THREAD_ID: ${{ github.event.comment.node_id }}
33+
COMMENT_ID: ${{ github.event.comment.id }}
34+
AUTHOR: ${{ github.event.comment.user.login }}
35+
BODY: ${{ github.event.comment.body }}
36+
URL: ${{ github.event.comment.html_url }}
37+
IS_PR: ${{ github.event.issue.pull_request != null || github.event_name == 'pull_request_review_comment' }}
38+
ISSUE_OR_PR_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}"
39+
40+
if [ -n "${{ github.event.comment.pull_request_review_id }}" ]; then
41+
ARGS="$ARGS
42+
REVIEW_ID: ${{ github.event.comment.pull_request_review_id }}"
43+
fi
44+
45+
if [ -n "${{ github.event.comment.in_reply_to_id }}" ]; then
46+
ARGS="$ARGS
47+
REPLY_TO_COMMENT_ID: ${{ github.event.comment.in_reply_to_id }}"
48+
fi
49+
50+
echo "args<<EOF" >> $GITHUB_OUTPUT
51+
echo "$ARGS" >> $GITHUB_OUTPUT
52+
echo "EOF" >> $GITHUB_OUTPUT
53+
54+
- name: Run Qoder Assistant
55+
uses: QoderAI/qoder-action@v0
56+
with:
57+
qoder_personal_access_token: ${{ secrets.QODER_PERSONAL_ACCESS_TOKEN }}
58+
prompt: |
59+
/assistant
60+
${{ steps.build_args.outputs.args }}

.github/workflows/code-review.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Qoder Auto Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
qoder-review:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
id-token: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Run Qoder Code Review
22+
uses: QoderAI/qoder-action@v0
23+
with:
24+
qoder_personal_access_token: ${{ secrets.QODER_PERSONAL_ACCESS_TOKEN }}
25+
prompt: |
26+
/review-pr
27+
REPO:${{ github.repository }} PR_NUMBER:${{ github.event.pull_request.number }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Qoder Push Code Review
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths-ignore:
8+
- '*.md'
9+
- 'docs/**'
10+
- '.gitignore'
11+
12+
jobs:
13+
qoder-review:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Run Qoder Code Review
26+
uses: QoderAI/qoder-action@v0
27+
with:
28+
qoder_personal_access_token: ${{ secrets.QODER_PERSONAL_ACCESS_TOKEN }}
29+
prompt: |
30+
/review
31+
Review the latest commit changes in this push.
32+
REPO:${{ github.repository }} COMMIT:${{ github.sha }} REF:${{ github.ref }}

0 commit comments

Comments
 (0)