From f5ee5762f0d76ccb3908a83f397ac182e16977e7 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Fri, 8 May 2026 13:37:28 -0400 Subject: [PATCH] ci/github-script/manual-file-edits: skip on PRs from one dev branch to another Same logic as in lint-commits. Fixes https://matrix.to/#/!EoslJfrUGMtQOAfnht:lassul.us/$govFR3OHnME2TZh7tcDSJfXAEfnMVUevnv4l5y4qFD0?via=nixos.org&via=matrix.org&via=catgirl.cloud --- ci/github-script/manual-file-edits.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ci/github-script/manual-file-edits.js b/ci/github-script/manual-file-edits.js index 84235d44752c..2f8d5caeb528 100644 --- a/ci/github-script/manual-file-edits.js +++ b/ci/github-script/manual-file-edits.js @@ -1,4 +1,5 @@ // @ts-check +const { classify } = require('../supportedBranches.js') const { getCommitDetailsForPR } = require('./get-pr-commit-details') /** @@ -32,6 +33,27 @@ async function checkManualFileEdits({ github, context, core, repoPath, dry }) { return } + const baseBranchType = classify( + pr.base.ref.replace(/^refs\/heads\//, ''), + ).type + const headBranchType = classify( + pr.head.ref.replace(/^refs\/heads\//, ''), + ).type + + if ( + baseBranchType.includes('development') && + headBranchType.includes('development') && + pr.base.repo.id === pr.head.repo?.id + ) { + // This matches, for example, PRs from NixOS:staging-next to NixOS:master, or vice versa. + // Ignore them: we should only care about PRs introducing *new* commits. + // We still want to run on PRs from, e.g., Someone:master to NixOS:master, though. + core.info( + 'This PR is from one development branch to another. Skipping checks.', + ) + return + } + const details = await getCommitDetailsForPR({ core, pr, repoPath }) if (