diff --git a/docs/usage/config-presets.md b/docs/usage/config-presets.md index b70a8f48bbabad3ccb52478f4e1984b7a8350cde..0afcd775de8299896198f093017ce7371a52456b 100644 --- a/docs/usage/config-presets.md +++ b/docs/usage/config-presets.md @@ -164,7 +164,7 @@ In short, the number of `{{argx}}` parameters in the definition is how many para Parameters must be strings, non-quoted, and separated by commas if there are more than one. If you find that you are repeating config a lot, you might consider publishing one of these types of parameterised presets yourself. -Or if you think your preset would be valuable for others, please contribute a PR to the Renovate repository. +Or if you think your preset would be valuable for others, please contribute a PR to the Renovate repository, see [Contributing to presets](#contributing-to-presets). ## GitHub-hosted Presets @@ -213,6 +213,9 @@ Renovate will determine the current platform and look up the preset from there. Have you configured a rule that you think others might benefit from? Please consider contributing it to the [Renovate repository](https://github.com/renovatebot/renovate/tree/main/lib/config/presets/internal) so that it gains higher visibility and saves others from reinventing the same thing. +Create a [discussion](https://github.com/renovatebot/renovate/discussions) to propose your preset to the Renovate maintainers. +The maintainers can also help improve the preset, and let you know where to put it in the code. + ## Organization level presets Whenever repository onboarding happens, Renovate checks if the current user/group/org has a default config to extend. diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index d9ed849b8e73deef2424c57fb429e7b52edb28c7..775d6aad22d333bf8a271c2ab96c04a672aa6800 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -854,7 +854,8 @@ The above would mean Renovate would not include files matching the above glob pa ## extends -See [shareable config presets](https://docs.renovatebot.com/config-presets) for details. +See [shareable config presets](./config-presets.md) for details. +Learn how to use presets by reading the [Key concepts, Presets](./key-concepts/presets.md/#how-to-use-presets) page. ## extractVersion diff --git a/docs/usage/key-concepts/presets.md b/docs/usage/key-concepts/presets.md index f6bf06d9b5991fd4147694949fd82c763bbc108e..f786f901e18730866e7abd67aba2aed1152847c8 100644 --- a/docs/usage/key-concepts/presets.md +++ b/docs/usage/key-concepts/presets.md @@ -16,6 +16,21 @@ Use presets to: - Share your configuration with others - Use somebody else's configuration and extend it with your own rules +## How to use presets + +Let's say you're using the `config:base` preset, and want to pin your GitHub Action digests. +Instead of writing your own Renovate config, you search through Renovate's built-in presets. +You find the the `helpers:pinGitHubActionDigests` preset and add it to the `extends` array: + +```json +{ + "extends": ["config:base", "helpers:pinGitHubActionDigests"] +} +``` + +Renovate now follows the rules for `config:base` plus the rules for `helpers:pinGitHubActionDigests`. +If there is a logical conflict between presets, then the last preset in the array wins. + ## Managing config for many repositories If you manage Renovate for many repositories, then you should create a global preset configuration. @@ -32,6 +47,12 @@ Renovate comes with a lot of built-in presets that you can use. Browse [Renovate's default presets](https://docs.renovatebot.com/presets-default/) to find any that are useful to you. Once you find a preset you like, put it in an `extends` array in your config file. +### Contributing a new built-in preset + +If you have a Renovate config that may help others, you can put it into Renovate's built-in presets. + +Read [Contributing to presets](./config-presets.md#contributing-to-presets) to learn how. + ## Summary In short: