n8n-nodes-github-copilot 1.1.1 → 1.1.2

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.
@@ -284,19 +284,41 @@ class GitHubCopilot {
284
284
  default:
285
285
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
286
286
  }
287
- const { stdout, stderr } = await execAsync(command, {
288
- env: {
289
- ...process.env,
290
- GH_TOKEN: accessToken,
291
- GITHUB_TOKEN: accessToken,
292
- GH_PAT: accessToken,
293
- HOME: '/opt/n8n-source/packages/cli/bin',
294
- },
295
- timeout: 30000,
296
- maxBuffer: 1024 * 1024,
297
- });
298
- if (stderr && !stdout) {
299
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot CLI error: ${stderr}`);
287
+ let stdout = '';
288
+ let stderr = '';
289
+ try {
290
+ const result = await execAsync(command, {
291
+ env: {
292
+ ...process.env,
293
+ GH_TOKEN: accessToken,
294
+ GITHUB_TOKEN: accessToken,
295
+ GH_PAT: accessToken,
296
+ HOME: '/opt/n8n-source/packages/cli/bin',
297
+ },
298
+ timeout: 30000,
299
+ maxBuffer: 1024 * 1024,
300
+ });
301
+ stdout = result.stdout;
302
+ stderr = result.stderr;
303
+ }
304
+ catch (execError) {
305
+ const err = execError;
306
+ stderr = err.stderr || err.message || String(execError);
307
+ stdout = err.stdout || '';
308
+ }
309
+ if (stderr) {
310
+ if (stderr.includes('internal server error') || stderr.includes('code: 400')) {
311
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot service is temporarily unavailable (HTTP 400). This is a GitHub server issue. Please try again in a few moments. Error: ${stderr}`);
312
+ }
313
+ else if (stderr.includes('401') || stderr.includes('Unauthorized') || stderr.includes('Bad credentials')) {
314
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub authentication failed. Please check your token has Copilot permissions. Error: ${stderr}`);
315
+ }
316
+ else if (stderr.includes('403') || stderr.includes('Forbidden')) {
317
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot access denied. Please ensure your account has Copilot subscription. Error: ${stderr}`);
318
+ }
319
+ else if (!stdout) {
320
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot CLI error: ${stderr}`);
321
+ }
300
322
  }
301
323
  const filterOutput = this.getNodeParameter('filterOutput', i, true);
302
324
  let processedOutput = stdout;
@@ -315,6 +337,7 @@ class GitHubCopilot {
315
337
  commandType: operation === 'shell' ? this.getNodeParameter('commandType', i) : undefined,
316
338
  output: processedOutput,
317
339
  cliRawOutput: stdout,
340
+ cliStderr: stderr || undefined,
318
341
  timestamp: new Date().toISOString(),
319
342
  },
320
343
  pairedItem: { item: i },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "n8n community node for GitHub Copilot CLI integration",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",