diff --git a/.github/scripts/create-platform-release-pr.sh b/.github/scripts/create-platform-release-pr.sh index 1fda86c0..5515769d 100755 --- a/.github/scripts/create-platform-release-pr.sh +++ b/.github/scripts/create-platform-release-pr.sh @@ -306,6 +306,15 @@ create_changelog_pr() { # Need to run from .github-tools context to inherit it's dependencies/environment echo "Current Directory: $(pwd)" PROJECT_GIT_DIR=$(pwd) + + # Resolve previous_version when it's a branch name: fetch and use origin/ + DIFF_BASE="${previous_version}" + if git ls-remote --heads origin "${previous_version}" | grep -qE "\srefs/heads/${previous_version}$"; then + echo "Detected remote branch for previous version: ${previous_version}" + git fetch origin "${previous_version}" + DIFF_BASE="origin/${previous_version}" + fi + cd ./github-tools/ ls -ltra corepack prepare yarn@4.5.1 --activate @@ -313,7 +322,7 @@ create_changelog_pr() { yarn --cwd install echo "Generating test plan csv.." - yarn run gen:commits "${platform}" "${previous_version}" "${release_branch_name}" "${PROJECT_GIT_DIR}" + yarn run gen:commits "${platform}" "${DIFF_BASE}" "${release_branch_name}" "${PROJECT_GIT_DIR}" if [[ "${TEST_ONLY:-false}" == 'false' ]]; then echo "Updating release sheet.." diff --git a/.github/scripts/generate-rc-commits.mjs b/.github/scripts/generate-rc-commits.mjs index 0be37e28..c1b86e22 100644 --- a/.github/scripts/generate-rc-commits.mjs +++ b/.github/scripts/generate-rc-commits.mjs @@ -18,7 +18,7 @@ const octokit = new Octokit({ auth: githubToken }); async function getTeam(repository, prNumber) { try { const { data: prData } = await octokit.pulls.get({ - owner: 'MetaMask', + owner: 'consensys-test', repo: repository, pull_number: prNumber[1], }); @@ -46,7 +46,7 @@ async function getTeam(repository, prNumber) { // Step 3: Match the PR author's username to a team const team = teamsJson[author]; - // Step 4: Return the team name or 'Unknown' if not found + // Step 4: Return the team name or 'Unknown' if not found. return team || 'Unknown'; } catch (error) { @@ -71,7 +71,7 @@ async function filterCommitsByTeam(platform, branchA, branchB) { repository = 'metamask-mobile'; break; case 'extension': - repository = 'metamask-extension'; + repository = 'metamask-extension-test-workflow2'; break; default: repository = 'metamask-mobile'; @@ -107,10 +107,10 @@ async function filterCommitsByTeam(platform, branchA, branchB) { } // Extract PR number from the commit message using regex - const prMatch = message.match(/\(#(\d{4,5})\)$/u); + const prMatch = message.match(/\(#(\d{1,5})\)$/u); if (prMatch) { const prLink = prMatch - ? `https://github.com/MetaMask/${repository}/pull/${prMatch[1]}` + ? `https://github.com/consensys-test/${repository}/pull/${prMatch[1]}` : ''; const team = await getTeam(repository, prMatch); diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 795ac9d7..b4ad7ba6 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -44,7 +44,7 @@ on: required: false type: string description: 'The Google Document ID for the release notes.' - default: '1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ' # Prod Release Document + default: '1rWSCoU07QxaP-H1Wkw-GNtwVNdeunDOjZoHoLXYxwkw' # Prod Release Document platform: required: true type: string