From 0823b14a5f8ce6ca08c9fc7f2c187811623fe521 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Thu, 23 Jul 2020 15:35:43 +0200 Subject: [PATCH] feat: dependency dashboard header and footer (#6839) Adds the ability to customize the dependency dashboard contents through customizable header and footer. --- docs/usage/configuration-options.md | 4 ++++ lib/config/common.ts | 2 ++ lib/config/definitions.ts | 14 ++++++++++++++ lib/workers/repository/dependency-dashboard.ts | 10 ++++++---- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 315d8fe7a8..87c56cbc7b 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -255,6 +255,10 @@ Note: Enabling Dependency Dashboard Approval implicitly enables `dependencyDashb You can configure this to `true` if you prefer Renovate to close an existing Dependency Dashboard whenever there are no outstanding PRs left. +## dependencyDashboardFooter + +## dependencyDashboardHeader + ## dependencyDashboardTitle Configure this option if you prefer a different title for the Dependency Dashboard. diff --git a/lib/config/common.ts b/lib/config/common.ts index cc7d542348..09dbd57c37 100644 --- a/lib/config/common.ts +++ b/lib/config/common.ts @@ -157,6 +157,8 @@ export interface RenovateConfig dependencyDashboardChecks?: Record<string, string>; dependencyDashboardRebaseAllOpen?: boolean; dependencyDashboardTitle?: string; + dependencyDashboardHeader?: string; + dependencyDashboardFooter?: string; packageFile?: string; packageRules?: PackageRule[]; prConcurrentLimit?: number; diff --git a/lib/config/definitions.ts b/lib/config/definitions.ts index 974515f474..687a38c045 100644 --- a/lib/config/definitions.ts +++ b/lib/config/definitions.ts @@ -415,6 +415,20 @@ const options: RenovateOptions[] = [ type: 'string', default: `Dependency Dashboard`, }, + { + name: 'dependencyDashboardHeader', + description: + 'Any text added here will be placed first in the Dependency Dashboard issue body.', + type: 'string', + default: + 'This issue contains a list of Renovate updates and their statuses.', + }, + { + name: 'dependencyDashboardFooter', + description: + 'Any text added here will be placed last in the Dependency Dashboard issue body, with a divider separator before it.', + type: 'string', + }, { name: 'configWarningReuseIssue', description: diff --git a/lib/workers/repository/dependency-dashboard.ts b/lib/workers/repository/dependency-dashboard.ts index 69d62579bc..3ece53276e 100644 --- a/lib/workers/repository/dependency-dashboard.ts +++ b/lib/workers/repository/dependency-dashboard.ts @@ -71,7 +71,10 @@ export async function ensureMasterIssue( } return; } - let issueBody = `This issue contains a list of Renovate updates and their statuses.\n\n`; + let issueBody = ''; + if (config.dependencyDashboardHeader?.length) { + issueBody += `${config.dependencyDashboardHeader}\n\n`; + } const pendingApprovals = branches.filter( (branch) => branch.res === 'needs-approval' ); @@ -202,9 +205,8 @@ export async function ensureMasterIssue( } // istanbul ignore if - if (global.appMode) { - issueBody += - '---\n<details><summary>Advanced</summary>\n\n- [ ] <!-- manual job -->Check this box to trigger a request for Renovate to run again on this repository\n\n</details>\n'; + if (config.dependencyDashboardFooter?.length) { + issueBody += `---\n${config.dependencyDashboardFooter}\n`; } if (config.dryRun) { -- GitLab