运行检查脚本:
python check_sensitive_info.py预期结果:应该显示73处"潜在问题",但这些都是正常的字段名和常量,不是真实敏感信息。
# 1. 在当前目录初始化新仓库
git init
# 2. 添加所有文件
git add .
# 3. 创建首次提交
git commit -m "Initial commit: Enterprise Text-to-SQL System
Features:
- Two-stage LLM architecture (Planner + Generator)
- Multi-layer security validation
- Semantic schema retrieval
- SQL injection protection
- Enterprise-grade EDR scenario support"
# 4. 在GitHub上创建新仓库(通过Web界面)
# 访问: https://github.com/new
# 仓库名建议: text-to-sql-enterprise
# 5. 连接到远程仓库
git remote add origin https://github.com/你的用户名/text-to-sql-enterprise.git
# 6. 推送到GitHub
git branch -M main
git push -u origin main# 1. 检查当前分支
git branch
# 2. 查看状态
git status
# 3. 添加新文件
git add .
# 4. 提交更改
git commit -m "Prepare for open source: Remove sensitive data and add documentation"
# 5. 推送
git push origin main- Repository name:
text-to-sql-enterprise或nl2sql-system - Description:
Enterprise-grade Text-to-SQL system with two-stage LLM architecture (Planner + Generator) and multi-layer security validation for EDR scenarios - Website: 可选,如果有文档站点
- Visibility: Public ✅
添加以下标签以提高可见性:
text-to-sql
natural-language-processing
llm
sql-generation
mysql
enterprise
security
python
nlp
database
ai
deep-learning
- ✅ Issues
- ✅ Projects (可选)
- ✅ Wiki (可选,用于详细文档)
- ✅ Discussions (可选,用于社区讨论)
-
General
- ✅ Template repository (可选,如果想让别人基于此创建)
- ✅ Require contributors to sign off on web-based commits
-
Branches
- 设置
main为默认分支 - 可选:添加分支保护规则
- 设置
-
About
- 添加描述
- 添加网站链接
- 添加Topics标签
在 README.md 顶部添加(如果还没有):
# Text-to-SQL Enterprise System



创建 .github/workflows/lint.yml:
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install flake8
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics# Changelog
All notable changes to this project will be documented in this file.
## [1.0.0] - 2025-10-05
### Added
- Two-stage LLM architecture (Planner + Generator)
- Multi-layer security validation
- Semantic schema retrieval
- SQL injection protection
- Comprehensive documentation
- MIT License
### Security
- Removed all sensitive business data
- Implemented SQL guard system
- Added AST validation创建一个公开的示例数据库:
-- example_data/sample_database.sql
CREATE DATABASE demo_edr;
USE demo_edr;
CREATE TABLE node (
id INT PRIMARY KEY AUTO_INCREMENT,
host VARCHAR(255),
ip VARCHAR(50),
os_type VARCHAR(50),
status VARCHAR(10)
);
-- 插入示例数据
INSERT INTO node (host, ip, os_type, status) VALUES
('server-001', '192.168.1.10', 'Ubuntu 20.04', '1'),
('server-002', '192.168.1.11', 'CentOS 7', '1'),
('server-003', '192.168.1.12', 'Windows Server 2019', '0');- README 显示正常
- LICENSE 文件可见
- 代码语法高亮正确
- 链接都能正常访问
- Issues 功能已启用
- 检查是否有人提出问题
- 准备回复第一个Issue/PR(展示项目活跃度)
- 分享到相关技术社区(可选)
- 定期查看Issues和PRs
- 更新文档
- 修复Bug
- 考虑添加更多示例
- 知乎:写一篇技术文章介绍架构设计
- 掘金:分享实现细节和踩坑经验
- CSDN:发布使用教程
- V2EX:在程序员板块分享
- Twitter/X:使用 #OpenSource #NLP #TextToSQL 标签
- LinkedIn:分享到技术群组
- Reddit:发到 r/Python, r/MachineLearning
- 如果有论文,添加到README的Citation部分
- 提交到 Papers with Code(如果适用)
- 再次确认没有推送
.env文件 - 再次确认没有真实数据库凭证
- 设置 GitHub Secret如果需要CI/CD
- 定期运行检查脚本,防止后续提交引入敏感信息
- 确保已获得公司授权(如适用)
- 确认不侵犯第三方知识产权
- 理解MIT License的含义
- 保留原始作者信息
发布成功后,你的项目将:
- ✅ 对全世界开发者可见
- ✅ 可以接收Issues和PRs
- ✅ 显示在你的GitHub Profile
- ✅ 可被搜索引擎索引
记得在README中添加你的联系方式,方便其他开发者联系你!
如果发布后发现问题:
- 立即删除包含敏感信息的文件
- 提交新的commit覆盖
- 如果在历史中,考虑重写历史或重建仓库
- 保持冷静和专业
- 仔细评估反馈的合理性
- 及时回复和修复
- 可以将仓库设为Private
- 或者直接删除仓库(无法恢复Fork)
祝你的开源项目成功! 🚀✨