@@ -18,7 +18,7 @@ const octokit = new Octokit({ auth: githubToken });
1818async function getTeam ( repository , prNumber ) {
1919 try {
2020 const { data : prData } = await octokit . pulls . get ( {
21- owner : 'MetaMask ' ,
21+ owner : 'consensys-test ' ,
2222 repo : repository ,
2323 pull_number : prNumber [ 1 ] ,
2424 } ) ;
@@ -46,8 +46,11 @@ async function getTeam(repository, prNumber) {
4646 // Step 3: Match the PR author's username to a team
4747 const team = teamsJson [ author ] ;
4848
49- // Step 4: Return the team name or 'Unknown' if not found
50- return team || 'Unknown' ;
49+ // Step 4: Return the team name or 'Unknown' if not found. Normalize to string.
50+ if ( Array . isArray ( team ) ) {
51+ return team . join ( ' & ' ) ;
52+ }
53+ return typeof team === 'string' && team . length > 0 ? team : 'Unknown' ;
5154
5255 } catch ( error ) {
5356 console . error (
@@ -71,7 +74,7 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
7174 repository = 'metamask-mobile' ;
7275 break ;
7376 case 'extension' :
74- repository = 'metamask-extension' ;
77+ repository = 'metamask-extension-test-workflow2 ' ;
7578 break ;
7679 default :
7780 repository = 'metamask-mobile' ;
@@ -107,10 +110,10 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
107110 }
108111
109112 // Extract PR number from the commit message using regex
110- const prMatch = message . match ( / \( # ( \d { 4 , 5 } ) \) $ / u) ;
113+ const prMatch = message . match ( / \( # ( \d { 1 , 5 } ) \) $ / u) ;
111114 if ( prMatch ) {
112115 const prLink = prMatch
113- ? `https://github.com/MetaMask /${ repository } /pull/${ prMatch [ 1 ] } `
116+ ? `https://github.com/consensys-test /${ repository } /pull/${ prMatch [ 1 ] } `
114117 : '' ;
115118 const team = await getTeam ( repository , prMatch ) ;
116119
@@ -204,7 +207,7 @@ async function main() {
204207
205208 if ( args . length !== 4 ) {
206209 console . error (
207- 'Usage: node generate-rc-commits.mjs platform branchA branchB' ,
210+ 'Usage: node generate-rc-commits.mjs platform branchA branchB gitDir ' ,
208211 ) ;
209212 console . error ( 'Received:' , args , ' with length:' , args . length ) ;
210213 process . exit ( 1 ) ;
0 commit comments