Skip to content

Commit ecb759c

Browse files
committed
ci: Support bot-authored commits in PR handler
Ensure both types of Copybara PR commits are correctly identified and parsed by checking author email, headers, and updated merge regex. Change-Id: Ic0cc19f67a3db4637fa597702393a11802b3f9aa
1 parent e56c021 commit ecb759c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/copybara-pr-handler.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,19 @@ jobs:
5858
console.log(`Committer: ${committer}`);
5959
6060
// Check if this is a Copybara commit
61-
if (committer !== 'Copybara-Service') {
61+
const isCopybara = committer === 'Copybara-Service' ||
62+
commit.author?.email === 'genai-sdk-bot@google.com' ||
63+
message.includes('GitOrigin-RevId:') ||
64+
message.includes('PiperOrigin-RevId:');
65+
66+
if (!isCopybara) {
6267
console.log('Not a Copybara commit, skipping');
6368
continue;
6469
}
6570
6671
// Extract PR number from commit message
67-
// Pattern: "Merge https://github.com/google/adk-python/pull/3333"
68-
const prMatch = message.match(/Merge https:\/\/github\.com\/google\/adk-python\/pull\/(\d+)/);
72+
// Pattern matches both "Merge https://..." and "Merge: https://..."
73+
const prMatch = message.match(/Merge:?\s+https:\/\/github\.com\/google\/adk-python\/pull\/(\d+)/);
6974
7075
if (!prMatch) {
7176
console.log('No PR number found in Copybara commit message');

0 commit comments

Comments
 (0)