diff --git a/scripts/releasing/patch-create-comment.js b/scripts/releasing/patch-create-comment.js index db700d317b..2001d3e0e0 100644 --- a/scripts/releasing/patch-create-comment.js +++ b/scripts/releasing/patch-create-comment.js @@ -132,7 +132,7 @@ async function main() { ) { // 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*```/, + /📋 Please run these commands manually to create the branch:[\s\S]*?```bash\s*([\s\S]*?)\s*```/, ); let manualCommands = ''; if (manualCommandsMatch) { diff --git a/scripts/tests/patch-create-comment.test.js b/scripts/tests/patch-create-comment.test.js index 803b6bec0e..402e03b2c5 100644 --- a/scripts/tests/patch-create-comment.test.js +++ b/scripts/tests/patch-create-comment.test.js @@ -255,6 +255,36 @@ describe('patch-create-comment', () => { }); }); + describe('GitHub App Permission Scenarios', () => { + it('should parse manual commands with clipboard emoji correctly', () => { + const result = runPatchCreateComment( + '--original-pr 8655 --exit-code 1 --commit abc1234 --channel stable --repository google-gemini/gemini-cli --test', + { + LOG_CONTENT: `❌ Failed to create release branch due to insufficient GitHub App permissions. + +📋 Please run these commands manually to create the branch: + +\`\`\`bash +git checkout -b hotfix/v0.4.1/stable/cherry-pick-abc1234 v0.4.1 +git push origin hotfix/v0.4.1/stable/cherry-pick-abc1234 +\`\`\``, + }, + ); + + expect(result.success).toBe(true); + expect(result.stdout).toContain('🔒 **GitHub App Permission Issue**'); + expect(result.stdout).toContain( + 'Please run these commands manually to create the release branch:', + ); + expect(result.stdout).toContain( + 'git checkout -b hotfix/v0.4.1/stable/cherry-pick-abc1234 v0.4.1', + ); + expect(result.stdout).toContain( + 'git push origin hotfix/v0.4.1/stable/cherry-pick-abc1234', + ); + }); + }); + describe('Test Mode Flag', () => { it('should generate mock content in test mode for success', () => { const result = runPatchCreateComment(