mirror of
https://github.com/1Panel-dev/CordysCRM.git
synced 2026-05-24 03:38:42 +08:00
build: CRM System Basic Scaffold
This commit is contained in:
35
.github/workflows/add-labels-for-pr.yml
vendored
Normal file
35
.github/workflows/add-labels-for-pr.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
on:
|
||||
issue_comment:
|
||||
types:
|
||||
- created
|
||||
|
||||
name: Add Labels to PR
|
||||
|
||||
jobs:
|
||||
add_labels:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 检查代码仓库
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 从评论中提取并格式化标签为 "用户名: 标签"
|
||||
- name: Extract reviewer and labels
|
||||
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/') }}
|
||||
id: extract_labels
|
||||
run: |
|
||||
comment_body="${{ github.event.comment.body }}"
|
||||
reviewer="${{ github.event.comment.user.login }}"
|
||||
raw_labels=$(echo "$comment_body" | sed 's|^/||')
|
||||
formatted_labels=$(echo "$raw_labels" | awk -v reviewer="$reviewer" '{split($0, arr, ","); for (i in arr) {gsub(/^ +| +$/, "", arr[i]); print reviewer ": " arr[i]}}')
|
||||
echo "Formatted labels: $formatted_labels"
|
||||
echo "::set-output name=labels::$formatted_labels"
|
||||
|
||||
# 将提取的标签添加到 PR
|
||||
- name: Add labels via PR comment
|
||||
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/') }}
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
labels: ${{ steps.extract_labels.outputs.labels }}
|
||||
17
.github/workflows/create-pr-from-push.yml
vendored
Normal file
17
.github/workflows/create-pr-from-push.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'pr@**'
|
||||
- 'repr@**'
|
||||
|
||||
name: Auto Create PR
|
||||
|
||||
jobs:
|
||||
generic_handler:
|
||||
name: Auto Create PR
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create pull request
|
||||
uses: jumpserver/action-generic-handler@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
33
.github/workflows/frontend-build.yml
vendored
Normal file
33
.github/workflows/frontend-build.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "frontend/**"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "frontend/**"
|
||||
|
||||
name: Frontend Code Checking
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
generic_handler:
|
||||
name: Frontend Code Checking
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
cache: 'maven'
|
||||
cache-dependency-path: '**/pom.xml' # optional
|
||||
check-latest: true
|
||||
- name: Build with Maven - only frontend
|
||||
run: mvn -T 1C -B package --file pom.xml -pl frontend
|
||||
28
.github/workflows/llm-code-review.yml
vendored
Normal file
28
.github/workflows/llm-code-review.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: LLM Code Review
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
llm-code-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: fit2cloud/LLM-CodeReview-Action@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.FIT2CLOUDRD_LLM_CODE_REVIEW_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.ALIYUN_LLM_API_KEY }}
|
||||
LANGUAGE: Chinese
|
||||
OPENAI_API_ENDPOINT: https://dashscope.aliyuncs.com/compatible-mode/v1
|
||||
MODEL: qwen2-1.5b-instruct
|
||||
PROMPT: "请检查下面的代码差异是否有不规范、潜在的问题或者优化建议,用中文回答。"
|
||||
top_p: 1
|
||||
temperature: 1
|
||||
# max_tokens: 10000
|
||||
MAX_PATCH_LENGTH: 10000
|
||||
IGNORE_PATTERNS: "/node_modules,*.md,/dist,/.github"
|
||||
FILE_PATTERNS: "*.java,*.go,*.py,*.vue,*.ts,*.js,*.css,*.scss,*.html"
|
||||
2
.github/workflows/typos-extend-exclude.toml
vendored
Normal file
2
.github/workflows/typos-extend-exclude.toml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
[files]
|
||||
extend-exclude = ["*.json", "**/*.json", "**/*.js", "**/*.html", "OWNERS", "CODEOWNERS", "LICENSE", "NOTICE"]
|
||||
23
.github/workflows/typos.yml
vendored
Normal file
23
.github/workflows/typos.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Typos Checking
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Spell Check with Typos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check spelling
|
||||
uses: crate-ci/typos@master
|
||||
with:
|
||||
config: .github/workflows/typos-extend-exclude.toml
|
||||
Reference in New Issue
Block a user