mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
fix comment formatting (#8900)
Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
This commit is contained in:
@@ -45,7 +45,6 @@ async function main() {
|
|||||||
.option('run-id', {
|
.option('run-id', {
|
||||||
description: 'The GitHub workflow run ID',
|
description: 'The GitHub workflow run ID',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '0',
|
|
||||||
})
|
})
|
||||||
.option('test', {
|
.option('test', {
|
||||||
description: 'Test mode - validate logic without GitHub API calls',
|
description: 'Test mode - validate logic without GitHub API calls',
|
||||||
@@ -80,6 +79,13 @@ async function main() {
|
|||||||
argv.repository || process.env.REPOSITORY || 'google-gemini/gemini-cli';
|
argv.repository || process.env.REPOSITORY || 'google-gemini/gemini-cli';
|
||||||
const runId = argv.runId || process.env.GITHUB_RUN_ID || '0';
|
const runId = argv.runId || process.env.GITHUB_RUN_ID || '0';
|
||||||
|
|
||||||
|
// Validate required parameters
|
||||||
|
if (!runId || runId === '0') {
|
||||||
|
console.warn(
|
||||||
|
'Warning: No valid GitHub run ID found, workflow links may not work correctly',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!originalPr) {
|
if (!originalPr) {
|
||||||
console.log('No original PR specified, skipping comment');
|
console.log('No original PR specified, skipping comment');
|
||||||
return;
|
return;
|
||||||
@@ -119,7 +125,40 @@ async function main() {
|
|||||||
logContent = process.env.LOG_CONTENT || '';
|
logContent = process.env.LOG_CONTENT || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logContent.includes('already has an open PR')) {
|
if (
|
||||||
|
logContent.includes(
|
||||||
|
'Failed to create release branch due to insufficient GitHub App permissions',
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
// GitHub App permission error - extract manual commands
|
||||||
|
const manualCommandsMatch = logContent.match(
|
||||||
|
/Please run these commands manually to create the branch:\s*\n\s*```bash\s*([\s\S]*?)\s*```/,
|
||||||
|
);
|
||||||
|
let manualCommands = '';
|
||||||
|
if (manualCommandsMatch) {
|
||||||
|
manualCommands = manualCommandsMatch[1].trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
commentBody = `🔒 **GitHub App Permission Issue**
|
||||||
|
|
||||||
|
The patch creation failed due to insufficient GitHub App permissions for creating workflow files.
|
||||||
|
|
||||||
|
**📝 Manual Action Required:**
|
||||||
|
${
|
||||||
|
manualCommands
|
||||||
|
? `Please run these commands manually to create the release branch:
|
||||||
|
|
||||||
|
\`\`\`bash
|
||||||
|
${manualCommands}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
After running these commands, you can re-run the patch workflow.`
|
||||||
|
: 'Please check the workflow logs for manual commands to run.'
|
||||||
|
}
|
||||||
|
|
||||||
|
**🔗 Links:**
|
||||||
|
- [View workflow run](https://github.com/${repository}/actions/runs/${runId})`;
|
||||||
|
} else if (logContent.includes('already has an open PR')) {
|
||||||
// Branch exists with existing PR
|
// Branch exists with existing PR
|
||||||
const prMatch = logContent.match(/Found existing PR #(\d+): (.*)/);
|
const prMatch = logContent.match(/Found existing PR #(\d+): (.*)/);
|
||||||
if (prMatch) {
|
if (prMatch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user