workflows/bot: allow maintainers to merge backports

All other conditions equal, there is no reason to prevent maintainers
from backporting changes to their packages. Maintainers are probably in
the *best* position to tell whether a certain change is backportable or
not - because they know the package well.
This commit is contained in:
Wolfgang Walther
2025-10-12 14:27:24 +02:00
parent c46f68da78
commit 91c4d9236b
3 changed files with 13 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
const { classify } = require('../supportedBranches.js')
function runChecklist({
committers,
files,
@@ -22,14 +24,14 @@ function runChecklist({
.reduce((acc, cur) => acc?.intersection(cur) ?? cur)
const checklist = {
'PR targets one of the allowed branches: master, staging, staging-next.': [
'master',
'staging',
'staging-next',
].includes(pull_request.base.ref),
'PR targets a [development branch](https://github.com/NixOS/nixpkgs/blob/-/ci/README.md#branch-classification).':
classify(pull_request.base.ref).type.includes('development'),
'PR touches only packages in `pkgs/by-name/`.': allByName,
'PR is at least one of:': {
'Authored by a committer.': committers.has(pull_request.user.id),
'Backported via label.':
pull_request.user.login === 'nixpkgs-ci[bot]' &&
pull_request.head.ref.startsWith('backport-'),
'Created by r-ryantm.': pull_request.user.login === 'r-ryantm',
},
}