diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index e0bdd18a359bfd5f724536bb4529b420a5d2b4c2..f3d6b0999743e4e07aca0eaca2a74db4f19e1ada 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -419,6 +419,7 @@ It will also override any settings in `packageRules`. This configuration option lets you choose an organization you want repositories forked into when "fork mode" is enabled. It must be set to a GitHub Organization name and not a GitHub user account. +When set, "allow edits by maintainers" will be false for PRs because GitHub does not allow this setting for organizations. This can be used if you're migrating from user-based forks to organization-based forks. diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 8b477ebbbaebb5417a1a84b14c40180033bc22fa..5370c458a743c1a3c1a1d6b2d35feef93f77e077 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -484,6 +484,7 @@ export async function initRepo({ if (forkToken) { logger.debug('Bot is in fork mode'); + config.forkOrg = forkOrg; config.forkToken = forkToken; // save parent name then delete config.parentRepo = config.repository; @@ -1572,6 +1573,7 @@ export async function createPr({ if (config.forkToken) { options.token = config.forkToken; options.body.maintainer_can_modify = + !config.forkOrg && platformOptions?.forkModeDisallowMaintainerEdits !== true; } logger.debug({ title, head, base, draft: draftPR }, 'Creating PR');