Change auth from TOKEN to PASSWORD in git auto-commit script

This commit is contained in:
Auto Commit
2026-03-20 17:50:07 +08:00
parent a14b3cb769
commit 1196cdafc0
31 changed files with 3452 additions and 7 deletions
+2 -3
View File
@@ -25,7 +25,7 @@
```
# 编辑 scripts/git-config.env
GIT_USERNAME=你的用户名
GIT_TOKEN=你的Access Token
GIT_PASSWORD=你的密码
```
2. **测试脚本**
@@ -49,8 +49,7 @@
## 安全提示
- `git-config.env` 文件包含敏感信息,已添加到 `.gitignore`
- **强烈建议**使用 Gitea Access Token 而不是密码
- 在 Gitea 中生成 Token: 用户设置 -> 应用 -> 生成令牌
- 请妥善保管你的密码
## 手动运行
@@ -51,11 +51,11 @@ def load_config():
key, value = line.split('=', 1)
config[key.strip()] = value.strip().strip('"\'')
if not config.get('GIT_USERNAME') or not config.get('GIT_TOKEN'):
print("错误: 请在配置文件中设置 GIT_USERNAME 和 GIT_TOKEN")
if not config.get('GIT_USERNAME') or not config.get('GIT_PASSWORD'):
print("错误: 请在配置文件中设置 GIT_USERNAME 和 GIT_PASSWORD")
sys.exit(1)
return config['GIT_USERNAME'], config['GIT_TOKEN']
return config['GIT_USERNAME'], config['GIT_PASSWORD']
def build_auth_url(repo_url, username, token):
@@ -146,7 +146,7 @@ def organize_skills():
# 创建 install.md
install_md_path = folder_path / "install.md"
zip_file_name = f"{zip_name}.zip"
install_content = f"skill名称={zip_name} 请执行以下流程:下载 https://gittea.dev/popiskill/skills/raw/branch/master/{cat_mapping}/{zip_name}/{zip_file_name} 文件,将该zip 解压至openclaw根目录(skill安装) ./skills/{zip_name} 目录,然后删除下载的临时文件。"
install_content = f"skill名称={zip_name} 请执行以下流程:下载 https://gittea.dev/popiskill/skills/raw/branch/master/{cat_mapping}/{zip_name}/{zip_file_name} 文件,将该zip 解压至openclaw根目录(skill安装) ./skills/{zip_name} 目录,然后删除下载的临时文件和文档"
with open(install_md_path, 'w', encoding='utf-8') as f:
f.write(install_content)