`The PR's base branch is set to \`${base}\`, but this PR causes ${maxRebuildCount} rebuilds.`,
'It is therefore considered a mass rebuild.',
`Please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) (probably \`${desiredBranch}\`).`,
].join('\n')
awaitpostReview({
github,
context,
core,
dry,
body,
event:'REQUEST_CHANGES',
})
thrownewError('This PR is against the wrong branch.')
}elseif (rebuildsAllTests){
letbranchText
if (base==='master'&&maxRebuildCount>=500){
branchText='(probably either `staging-nixos` or `staging`)'
`The PR's base branch is set to \`${base}\`, but this PR rebuilds all NixOS tests.`,
base==='master'&&maxRebuildCount>=500
?`Since this PR also causes ${maxRebuildCount} rebuilds, it may also be considered a mass rebuild.`
:'',
`Please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) ${branchText}.`,
].join('\n')
awaitpostReview({
github,
context,
core,
dry,
body,
event:'REQUEST_CHANGES',
})
thrownewError('This PR is against the wrong branch.')
`The PR's base branch is set to \`${base}\`, and this PR causes ${maxRebuildCount} rebuilds.`,
`Please consider whether this PR causes a mass rebuild according to [our conventions](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions).`,
`If it does cause a mass rebuild, please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) (probably \`${stagingBranch}\`).`,
`If it does not cause a mass rebuild, this message can be ignored.`,
].join('\n')
awaitpostReview({
github,
context,
core,
dry,
body,
event:'COMMENT',
})
}else{
// Any existing reviews were dismissed by commits.js
core.info('checkTargetBranch: this PR is against an appropriate branch.')