mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-22 02:15:36 +08:00
chore: 修改readme相关调整
This commit is contained in:
68
.gitee/CONTRIBUTING.md
Normal file
68
.gitee/CONTRIBUTING.md
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
# Contributing to ONEX OMS
|
||||||
|
|
||||||
|
感谢你对 ONEX OMS 的贡献意愿!请遵循以下简要流程:
|
||||||
|
|
||||||
|
## 快速流程
|
||||||
|
1. Fork 仓库并创建特性分支:`git checkout -b feature/your-change`
|
||||||
|
2. 安装依赖:`composer install --no-dev`
|
||||||
|
3. 开发与自测:推荐运行相关单测(如有)与基础功能验证
|
||||||
|
4. 提交:遵循 Conventional Commits,例如 `feat: add xxx`
|
||||||
|
5. 提交 PR:描述改动、测试范围、风险点
|
||||||
|
|
||||||
|
## 规范要点
|
||||||
|
- 提交信息:使用 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
|
||||||
|
- 代码风格:参考 [编码规范(在线版)](https://op.shopex.cn/doc_oms_dev/100.rule/1.code.html)
|
||||||
|
- 配置与安装:参考 [部署指南(在线版)](https://op.shopex.cn/doc_oms_dev/200.install-deploy/deployment-guide.html)
|
||||||
|
|
||||||
|
## 问题反馈
|
||||||
|
- Bug / 需求:创建 Issue,并附上复现场景、期望行为、环境信息
|
||||||
|
- 安全问题:请勿公开提 Issue,可通过私下渠道联系维护者
|
||||||
|
|
||||||
|
## Gitee Go CI/CD
|
||||||
|
|
||||||
|
本项目使用 Gitee Go 进行持续集成,配置文件位于 `.gitee/workflows/` 目录。
|
||||||
|
|
||||||
|
### 自动检查
|
||||||
|
|
||||||
|
提交代码时,Gitee Go 会自动运行以下检查:
|
||||||
|
|
||||||
|
- **提交信息格式检查** (`commitlint.yml`):检查提交信息是否符合 Conventional Commits 规范
|
||||||
|
- 触发时机:推送到 `master` 分支或创建/更新 Pull Request
|
||||||
|
- 检查内容:提交信息格式、类型、描述等
|
||||||
|
|
||||||
|
### 提交信息格式要求
|
||||||
|
|
||||||
|
提交信息应遵循以下格式:
|
||||||
|
|
||||||
|
```
|
||||||
|
<type>(<scope>): <subject>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
```
|
||||||
|
|
||||||
|
**类型 (type)**:
|
||||||
|
- `feat`: 新功能
|
||||||
|
- `fix`: 修复 bug
|
||||||
|
- `docs`: 文档更新
|
||||||
|
- `style`: 代码格式调整(不影响功能)
|
||||||
|
- `refactor`: 代码重构
|
||||||
|
- `test`: 测试相关
|
||||||
|
- `chore`: 构建/工具链相关
|
||||||
|
|
||||||
|
**示例**:
|
||||||
|
```
|
||||||
|
feat: 添加用户登录功能
|
||||||
|
fix(api): 修复订单查询接口的 bug
|
||||||
|
docs: 更新 README 文档
|
||||||
|
```
|
||||||
|
|
||||||
|
### 注意事项
|
||||||
|
|
||||||
|
- 确保提交信息符合规范,否则 CI 检查会失败
|
||||||
|
- 如果 CI 检查失败,请查看 Gitee Go 的日志输出
|
||||||
|
- 更多关于 Gitee Go 的使用说明,请参考 [Gitee Go 官方文档](https://gitee.com/help/articles/4292)
|
||||||
|
|
||||||
|
感谢你的贡献!
|
||||||
|
|
||||||
41
.gitee/workflows/commitlint.simple.yml
Normal file
41
.gitee/workflows/commitlint.simple.yml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Gitee Go Workflow - Commitlint (简化版本)
|
||||||
|
# 如果 commitlint.yml 不兼容,可以尝试使用此版本
|
||||||
|
# 使用方法:将此文件重命名为 commitlint.yml
|
||||||
|
|
||||||
|
name: commitlint-simple
|
||||||
|
displayName: Commitlint 提交信息检查(简化版)
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- name: lint
|
||||||
|
displayName: 提交信息检查
|
||||||
|
steps:
|
||||||
|
- name: 安装依赖并检查提交信息
|
||||||
|
type: shell
|
||||||
|
commands: |
|
||||||
|
# 检查 Node.js 是否可用
|
||||||
|
if command -v node >/dev/null 2>&1; then
|
||||||
|
echo "Node.js 已安装: $(node --version)"
|
||||||
|
else
|
||||||
|
echo "错误: 未找到 Node.js,请确保 Gitee Go 环境已安装 Node.js"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 安装 commitlint
|
||||||
|
npm install -g @commitlint/cli @commitlint/config-conventional
|
||||||
|
|
||||||
|
# 创建配置文件
|
||||||
|
echo '{"extends": ["@commitlint/config-conventional"]}' > .commitlintrc.json
|
||||||
|
|
||||||
|
# 检查提交信息(简化版:只检查最新提交)
|
||||||
|
echo "检查最新提交信息..."
|
||||||
|
npx commitlint --from HEAD~1 --to HEAD --verbose
|
||||||
|
|
||||||
59
.gitee/workflows/commitlint.yml
Normal file
59
.gitee/workflows/commitlint.yml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: commitlint
|
||||||
|
displayName: Commitlint 提交信息检查
|
||||||
|
|
||||||
|
triggers:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- name: lint
|
||||||
|
displayName: 提交信息检查
|
||||||
|
steps:
|
||||||
|
- step: shell@general
|
||||||
|
name: commitlint-check
|
||||||
|
displayName: 验证提交信息格式
|
||||||
|
inputs:
|
||||||
|
commands: |
|
||||||
|
# 安装 Node.js (如果未安装)
|
||||||
|
if ! command -v node &> /dev/null; then
|
||||||
|
echo "安装 Node.js..."
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
|
apt-get install -y nodejs || yum install -y nodejs npm
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 显示 Node.js 版本
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
|
||||||
|
# 安装 commitlint
|
||||||
|
echo "安装 commitlint..."
|
||||||
|
npm install -g @commitlint/cli @commitlint/config-conventional
|
||||||
|
|
||||||
|
# 创建 commitlint 配置文件
|
||||||
|
cat > .commitlintrc.json << 'EOF'
|
||||||
|
{
|
||||||
|
"extends": ["@commitlint/config-conventional"]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# 验证提交信息
|
||||||
|
echo "开始检查提交信息..."
|
||||||
|
# 获取最近的提交进行验证
|
||||||
|
if [ -n "$CI_COMMIT_REF_NAME" ] && [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
|
||||||
|
# PR/MR 事件:验证所有新提交
|
||||||
|
echo "检查 Pull Request 提交信息..."
|
||||||
|
BASE_SHA=$(git merge-base origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-master} HEAD)
|
||||||
|
npx commitlint --from "$BASE_SHA" --to HEAD --verbose || exit 1
|
||||||
|
else
|
||||||
|
# Push 事件:验证最新的提交
|
||||||
|
echo "检查 Push 提交信息..."
|
||||||
|
npx commitlint --from HEAD~1 --to HEAD --verbose || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
22
.github/CONTRIBUTING.md
vendored
22
.github/CONTRIBUTING.md
vendored
@@ -1,22 +0,0 @@
|
|||||||
# Contributing to ONEX OMS
|
|
||||||
|
|
||||||
感谢你对 ONEX OMS 的贡献意愿!请遵循以下简要流程:
|
|
||||||
|
|
||||||
## 快速流程
|
|
||||||
1. Fork 仓库并创建特性分支:`git checkout -b feature/your-change`
|
|
||||||
2. 安装依赖:`composer install --no-dev`
|
|
||||||
3. 开发与自测:推荐运行相关单测(如有)与基础功能验证
|
|
||||||
4. 提交:遵循 Conventional Commits,例如 `feat: add xxx`
|
|
||||||
5. 提交 PR:描述改动、测试范围、风险点
|
|
||||||
|
|
||||||
## 规范要点
|
|
||||||
- 提交信息:使用 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
||||||
- 代码风格:参考 [编码规范(在线版)](https://op.shopex.cn/doc_oms_dev/100.rule/1.code.html)
|
|
||||||
- 配置与安装:参考 [部署指南(在线版)](https://op.shopex.cn/doc_oms_dev/200.install-deploy/deployment-guide.html)
|
|
||||||
|
|
||||||
## 问题反馈
|
|
||||||
- Bug / 需求:创建 Issue,并附上复现场景、期望行为、环境信息
|
|
||||||
- 安全问题:请勿公开提 Issue,可通过私下渠道联系维护者
|
|
||||||
|
|
||||||
感谢你的贡献!
|
|
||||||
|
|
||||||
20
.github/workflows/commitlint.yml
vendored
20
.github/workflows/commitlint.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: Commitlint
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, edited]
|
|
||||||
push:
|
|
||||||
branches: [main, master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Validate commits with commitlint
|
|
||||||
uses: wagoid/commitlint-github-action@v6
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user