ai-git-tools 2.0.32 → 2.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -114,18 +114,6 @@ export class GitHubAPI {
|
|
|
114
114
|
*/
|
|
115
115
|
async fetchTeams(orgName = this.orgName) {
|
|
116
116
|
try {
|
|
117
|
-
// 先檢查認證狀態
|
|
118
|
-
const authStatus = this.checkAuth();
|
|
119
|
-
if (!authStatus.authenticated) {
|
|
120
|
-
log.error('\n❌ GitHub CLI 未認證\n');
|
|
121
|
-
console.log('請先執行認證:');
|
|
122
|
-
console.log(` ${colors.green}gh auth login${colors.reset}\n`);
|
|
123
|
-
console.log('選擇認證範圍時,請確保包含:');
|
|
124
|
-
console.log(' - repo (必需)');
|
|
125
|
-
console.log(' - read:org (如需使用 reviewer 功能)\n');
|
|
126
|
-
throw new Error('GitHub CLI 未認證,無法創建 PR');
|
|
127
|
-
}
|
|
128
|
-
|
|
129
117
|
log.step(`正在從 GitHub 抓取 ${orgName} 的團隊資訊...`);
|
|
130
118
|
|
|
131
119
|
let teamsJson;
|
|
@@ -32,6 +32,20 @@ export class PRWorkflow {
|
|
|
32
32
|
* 執行完整工作流程
|
|
33
33
|
*/
|
|
34
34
|
async execute() {
|
|
35
|
+
// 0. 檢查 GitHub CLI 認證狀態(預覽模式不需要)
|
|
36
|
+
if (!this.config.preview) {
|
|
37
|
+
const authStatus = this.github.checkAuth();
|
|
38
|
+
if (!authStatus.authenticated) {
|
|
39
|
+
this.logger.error('\n❌ GitHub CLI 未認證\n');
|
|
40
|
+
console.log('請先執行認證:');
|
|
41
|
+
console.log(` ${this.logger.colors.green}gh auth login${this.logger.colors.reset}\n`);
|
|
42
|
+
console.log('選擇認證範圍時,請確保包含:');
|
|
43
|
+
console.log(' - repo (必需)');
|
|
44
|
+
console.log(' - read:org (如需使用 reviewer 功能)\n');
|
|
45
|
+
throw new Error('GitHub CLI 未認證,無法創建 PR');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
35
49
|
// 1. 驗證環境和分支
|
|
36
50
|
const { baseBranch, headBranch } = await this.detectAndValidateBranches();
|
|
37
51
|
|