fix(release): Update create-patch-pr.js to take a package name (#11400)

This commit is contained in:
Richie Foreman
2025-10-17 15:02:44 -04:00
committed by GitHub
parent 8da47db1a4
commit 6786684962

View File

@@ -30,6 +30,12 @@ async function main() {
choices: ['stable', 'preview'],
demandOption: true,
})
.option('cli-package-name', {
description:
'fully qualified package name with scope (e.g @google/gemini-cli)',
string: true,
default: '@google/gemini-cli',
})
.option('dry-run', {
description: 'Whether to run in dry-run mode.',
type: 'boolean',
@@ -48,7 +54,7 @@ async function main() {
run('git fetch --all --tags --prune', dryRun);
const releaseInfo = getLatestReleaseInfo(channel);
const releaseInfo = getLatestReleaseInfo({ argv, channel });
const latestTag = releaseInfo.currentTag;
const nextVersion = releaseInfo.nextVersion;
@@ -267,10 +273,10 @@ function branchExists(branchName) {
}
}
function getLatestReleaseInfo(channel) {
function getLatestReleaseInfo({ argv, channel } = {}) {
console.log(`Fetching latest release info for channel: ${channel}...`);
const patchFrom = channel; // 'stable' or 'preview'
const command = `node scripts/get-release-version.js --type=patch --patch-from=${patchFrom}`;
const command = `node scripts/get-release-version.js --cli-package-name="${argv['cli-package-name']}" --type=patch --patch-from=${patchFrom}`;
try {
const result = JSON.parse(execSync(command).toString().trim());
console.log(`Current ${channel} tag: ${result.previousReleaseTag}`);