mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix(automerge): force PR creation on dashboard approval (#21924)
This commit is contained in:
parent
168b872423
commit
d6edbb2e2d
2 changed files with 23 additions and 1 deletions
|
@ -396,6 +396,23 @@ describe('workers/repository/update/pr/index', () => {
|
|||
expect(prCache.setPrCache).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('forces PR on dashboard check', async () => {
|
||||
platform.createPr.mockResolvedValueOnce(pr);
|
||||
|
||||
const res = await ensurePr({
|
||||
...config,
|
||||
automerge: true,
|
||||
automergeType: 'branch',
|
||||
reviewers: ['somebody'],
|
||||
dependencyDashboardChecks: {
|
||||
'renovate-branch': 'approvePr',
|
||||
},
|
||||
});
|
||||
|
||||
expect(res).toEqual({ type: 'with-pr', pr });
|
||||
expect(prCache.setPrCache).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('adds assignees for PR automerge with red status', async () => {
|
||||
const changedPr: Pr = {
|
||||
...pr,
|
||||
|
|
|
@ -143,6 +143,11 @@ export async function ensurePr(
|
|||
config.forcePr = true;
|
||||
}
|
||||
|
||||
if (dependencyDashboardCheck === 'approvePr') {
|
||||
logger.debug('Forcing PR because of dependency dashboard approval');
|
||||
config.forcePr = true;
|
||||
}
|
||||
|
||||
if (!existingPr) {
|
||||
// Only create a PR if a branch automerge has failed
|
||||
if (
|
||||
|
@ -172,7 +177,7 @@ export async function ensurePr(
|
|||
return { type: 'without-pr', prBlockedBy: 'BranchAutomerge' };
|
||||
}
|
||||
}
|
||||
if (!existingPr && config.prCreation === 'status-success') {
|
||||
if (config.prCreation === 'status-success') {
|
||||
logger.debug('Checking branch combined status');
|
||||
if ((await getBranchStatus()) !== 'green') {
|
||||
logger.debug(`Branch status isn't green - not creating PR`);
|
||||
|
|
Loading…
Reference in a new issue