feat: Use PAT for gemini-cli-robot in release workflows (#9804)

Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
This commit is contained in:
matt korwel
2025-09-26 16:35:26 -07:00
committed by GitHub
parent 24c15b9d43
commit 38dccf32c1
8 changed files with 295 additions and 469 deletions

View File

@@ -36,9 +36,35 @@ run(`npm version ${versionType} --no-git-tag-version --allow-same-version`);
// 3. Get all workspaces and filter out the one we don't want to version.
const workspacesToExclude = [];
const lsOutput = JSON.parse(
execSync('npm ls --workspaces --json --depth=0').toString(),
);
let lsOutput;
try {
lsOutput = JSON.parse(
execSync('npm ls --workspaces --json --depth=0').toString(),
);
} catch (e) {
// `npm ls` can exit with a non-zero status code if there are issues
// with dependencies, but it will still produce the JSON output we need.
// We'll try to parse the stdout from the error object.
if (e.stdout) {
console.warn(
'Warning: `npm ls` exited with a non-zero status code. Attempting to proceed with the output.',
);
try {
lsOutput = JSON.parse(e.stdout.toString());
} catch (parseError) {
console.error(
'Error: Failed to parse JSON from `npm ls` output even after `npm ls` failed.',
);
console.error('npm ls stderr:', e.stderr.toString());
console.error('Parse error:', parseError);
process.exit(1);
}
} else {
console.error('Error: `npm ls` failed with no output.');
console.error(e.stderr?.toString() || e);
process.exit(1);
}
}
const allWorkspaces = Object.keys(lsOutput.dependencies || {});
const workspacesToVersion = allWorkspaces.filter(
(wsName) => !workspacesToExclude.includes(wsName),
@@ -76,6 +102,8 @@ if (cliPackageJson.config?.sandboxImageUri) {
}
// 6. Run `npm install` to update package-lock.json.
run('npm install');
run(
'npm install --workspace packages/cli --workspace packages/core --package-lock-only',
);
console.log(`Successfully bumped versions to v${newVersion}.`);