Skip to content

Commit 222b13e

Browse files
authored
chore: only gh auth login for the ci (#4562)
1 parent 7d8a388 commit 222b13e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/ci/codegen/pushToRepository.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import fsp from 'fs/promises';
22
import path, { resolve } from 'path';
33

44
import {
5+
CI,
56
configureGitHubAuthor,
67
ensureGitHubToken,
78
exists,
@@ -158,8 +159,7 @@ async function pushToRepository(repository: string, config: RepositoryConfigurat
158159
head: task.prBranch,
159160
});
160161

161-
await run(`echo ${ensureGitHubToken()} | gh auth login --with-token`);
162-
await run(`gh --repo ${OWNER}/${repository} pr merge ${data.number} --auto`);
162+
await run(`gh --repo ${OWNER}/${repository} pr merge ${data.number} --squash --auto`);
163163

164164
console.log(`Pull request created on ${OWNER}/${repository}`);
165165
console.log(` > ${data.url}`);
@@ -170,6 +170,10 @@ if (import.meta.url.endsWith(process.argv[1])) {
170170
setVerbose(false);
171171
const repositories = process.argv.slice(2) as Array<string>;
172172

173+
if (CI) {
174+
await run(`echo ${ensureGitHubToken()} | gh auth login --with-token`);
175+
}
176+
173177
await Promise.allSettled(
174178
Object.entries(pushToRepositoryConfiguration).map(([name, config]) => {
175179
if (repositories.length === 0 || repositories.includes(name)) {

0 commit comments

Comments
 (0)