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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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