gitpadi 2.0.4 → 2.0.5

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.
@@ -94,7 +94,10 @@ function parseMarkdownIssues(content) {
94
94
  for (let i = 1; i < lines.length; i++) {
95
95
  const labelsMatch = lines[i].match(/^\*\*Labels?:\*\*\s*(.+)/i);
96
96
  if (labelsMatch) {
97
- labels = labelsMatch[1].split(',').map(l => l.trim()).filter(Boolean);
97
+ // Strip backticks and trim
98
+ labels = labelsMatch[1].split(',')
99
+ .map(l => l.trim().replace(/^`+/, '').replace(/`+$/, ''))
100
+ .filter(Boolean);
98
101
  }
99
102
  else {
100
103
  bodyLines.push(lines[i]);
@@ -196,6 +199,21 @@ export async function createIssuesFromFile(filePath, opts) {
196
199
  await new Promise((r) => setTimeout(r, 1200));
197
200
  }
198
201
  catch (e) {
202
+ // If it's a 403 (unauthorized labels), try again without labels
203
+ if (e.status === 403 && issue.labels?.length > 0) {
204
+ try {
205
+ const { data } = await octokit.issues.create({
206
+ owner: getOwner(), repo: getRepo(), title: issue.title, body: issue.body,
207
+ });
208
+ created++;
209
+ console.log(` ${chalk.green('✅')} #${String(issue.number).padStart(2, '0')} → GitHub #${data.number} ${chalk.yellow('(labels skipped - permission)')}`);
210
+ await new Promise((r) => setTimeout(r, 1200));
211
+ continue;
212
+ }
213
+ catch (retryErr) {
214
+ e = retryErr;
215
+ }
216
+ }
199
217
  failed++;
200
218
  console.log(` ${chalk.red('❌')} #${String(issue.number).padStart(2, '0')}: ${e.message}`);
201
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitpadi",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "GitPadi — Your AI-powered GitHub management CLI. Create repos, manage issues & PRs, score contributors, and automate everything.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -109,7 +109,10 @@ function parseMarkdownIssues(content: string): { issues: any[]; labels: Record<s
109
109
  for (let i = 1; i < lines.length; i++) {
110
110
  const labelsMatch = lines[i].match(/^\*\*Labels?:\*\*\s*(.+)/i);
111
111
  if (labelsMatch) {
112
- labels = labelsMatch[1].split(',').map(l => l.trim()).filter(Boolean);
112
+ // Strip backticks and trim
113
+ labels = labelsMatch[1].split(',')
114
+ .map(l => l.trim().replace(/^`+/, '').replace(/`+$/, ''))
115
+ .filter(Boolean);
113
116
  } else {
114
117
  bodyLines.push(lines[i]);
115
118
  }
@@ -214,6 +217,20 @@ export async function createIssuesFromFile(filePath: string, opts: { dryRun?: bo
214
217
  console.log(` ${chalk.green('✅')} #${String(issue.number).padStart(2, '0')} → GitHub #${data.number}`);
215
218
  await new Promise((r) => setTimeout(r, 1200));
216
219
  } catch (e: any) {
220
+ // If it's a 403 (unauthorized labels), try again without labels
221
+ if (e.status === 403 && issue.labels?.length > 0) {
222
+ try {
223
+ const { data } = await octokit.issues.create({
224
+ owner: getOwner(), repo: getRepo(), title: issue.title, body: issue.body,
225
+ });
226
+ created++;
227
+ console.log(` ${chalk.green('✅')} #${String(issue.number).padStart(2, '0')} → GitHub #${data.number} ${chalk.yellow('(labels skipped - permission)')}`);
228
+ await new Promise((r) => setTimeout(r, 1200));
229
+ continue;
230
+ } catch (retryErr: any) {
231
+ e = retryErr;
232
+ }
233
+ }
217
234
  failed++;
218
235
  console.log(` ${chalk.red('❌')} #${String(issue.number).padStart(2, '0')}: ${e.message}`);
219
236
  }