Skip to content

Commit 883a5f0

Browse files
committed
chore: wait before auto merge
1 parent 11d3822 commit 883a5f0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

scripts/ci/codegen/pushToRepository.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { pushToRepositoryConfiguration } from './types.ts';
2020

2121
import { getClientsConfigField } from '../../config.ts';
2222
import { commitStartRelease } from './text.ts';
23+
import { sleep } from './waitForAllReleases.ts';
2324

2425
async function handleSpecFiles(spec: SpecsToPush, tempGitDir: string): Promise<void> {
2526
const pathToSpecs = toAbsolutePath(`${tempGitDir}/${spec.output}`);
@@ -158,6 +159,9 @@ async function pushToRepository(repository: string, config: RepositoryConfigurat
158159
head: task.prBranch,
159160
});
160161

162+
// the graphql api of gh might have some cache so we need to wait a bit
163+
await sleep(10_000);
164+
161165
await run(`gh pr merge ${data.number} --auto`);
162166

163167
console.log(`Pull request created on ${OWNER}/${repository}`);

scripts/ci/codegen/waitForAllReleases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function fetchAllRuns(runs: Run[]): Promise<void> {
4444
);
4545
}
4646

47-
function sleep(ms: number): Promise<void> {
47+
export function sleep(ms: number): Promise<void> {
4848
return new Promise((resolve) => {
4949
setTimeout(resolve, ms);
5050
});

0 commit comments

Comments
 (0)