From 854bbafc8c76b9f67e6f9ce4ba14b6b7463a86ed Mon Sep 17 00:00:00 2001 From: Bastian Gutschke Date: Wed, 26 Apr 2023 19:05:27 +0200 Subject: [PATCH] fix(post-upgrade-tasks)!: enable dot option for file filters (#21282) Set `{ dot: true }` for minimatch. BREAKING CHANGE: dot files will now be included by default for all minimatch results --- docs/usage/configuration-options.md | 1 + .../repository/update/branch/execute-post-upgrade-commands.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 3b3a11dda9033b..b039a1d4b9e68c 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2561,6 +2561,7 @@ You can use variable templating in your commands as long as [`allowPostUpgradeCo ### fileFilters A list of glob-style matchers that determine which files will be included in the final commit made by Renovate. +Dotfiles are included. ### executionMode diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts index be8b39f4ec65c6..9efb844b0dc2bb 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.ts @@ -106,7 +106,7 @@ export async function postUpgradeCommandsExecutor( for (const relativePath of status.modified.concat(status.not_added)) { for (const pattern of fileFilters) { - if (minimatch(relativePath, pattern)) { + if (minimatch(relativePath, pattern, { dot: true })) { logger.debug( { file: relativePath, pattern }, 'Post-upgrade file saved' @@ -134,7 +134,7 @@ export async function postUpgradeCommandsExecutor( for (const relativePath of status.deleted || []) { for (const pattern of fileFilters) { - if (minimatch(relativePath, pattern)) { + if (minimatch(relativePath, pattern, { dot: true })) { logger.debug( { file: relativePath, pattern }, 'Post-upgrade file removed'