Skip to content
Snippets Groups Projects
Unverified Commit 11a558b2 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(automerge): allow repeate automerge for groups (#22787)

parent 18c2850f
Branches
Tags
No related merge requests found
...@@ -20,13 +20,13 @@ describe('workers/repository/update/branch/check-existing', () => { ...@@ -20,13 +20,13 @@ describe('workers/repository/update/branch/check-existing', () => {
}); });
it('returns false if recreating closed PRs', async () => { it('returns false if recreating closed PRs', async () => {
config.recreateWhen = 'always'; config.recreateClosed = true;
expect(await prAlreadyExisted(config)).toBeNull(); expect(await prAlreadyExisted(config)).toBeNull();
expect(platform.findPr).toHaveBeenCalledTimes(0); expect(platform.findPr).toHaveBeenCalledTimes(0);
}); });
it('returns false if check misses', async () => { it('returns false if check misses', async () => {
config.recreateWhen = 'auto'; config.recreateClosed = false;
expect(await prAlreadyExisted(config)).toBeNull(); expect(await prAlreadyExisted(config)).toBeNull();
expect(platform.findPr).toHaveBeenCalledTimes(1); expect(platform.findPr).toHaveBeenCalledTimes(1);
}); });
......
...@@ -8,8 +8,8 @@ export async function prAlreadyExisted( ...@@ -8,8 +8,8 @@ export async function prAlreadyExisted(
config: BranchConfig config: BranchConfig
): Promise<Pr | null> { ): Promise<Pr | null> {
logger.trace({ config }, 'prAlreadyExisted'); logger.trace({ config }, 'prAlreadyExisted');
if (config.recreateWhen === 'always') { if (config.recreateClosed) {
logger.debug('recreateWhen is "always". No need to check for closed PR.'); logger.debug('recreateClosed is true. No need to check for closed PR.');
return null; return null;
} }
logger.debug( logger.debug(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment