Skip to content

Commit 22f3389

Browse files
authored
Merge pull request #33697 from github/repo-sync
Repo sync
2 parents b9b48af + 2a0592d commit 22f3389

10 files changed

+125
-6
lines changed

content/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file.md

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ For a real-world example of `dependabot.yml` file, see [{% data variables.produ
4646
The top-level `updates` key is mandatory. You use it to configure how {% data variables.product.prodname_dependabot %} updates the versions or your project's dependencies. Each entry configures the update settings for a particular package manager. You can use the following options.
4747

4848
{% data reusables.dependabot.configuration-options %}
49+
{% ifversion dependabot-updates-multidirectory-support %}
4950

51+
{% data reusables.dependabot.directory-directories-required %}
52+
53+
{% endif %}
5054
These options fit broadly into the following categories.
5155

52-
* Essential set up options that you must include in all configurations: [`package-ecosystem`](#package-ecosystem), [`directory`](#directory),[`schedule.interval`](#scheduleinterval).
56+
* Essential set up options that you must include in all configurations: [`package-ecosystem`](#package-ecosystem), [`directory`](#directory){% ifversion dependabot-updates-multidirectory-support %} or [`directories`](#directories){% endif %},[`schedule.interval`](#scheduleinterval).
5357
* Options to customize the update schedule: [`schedule.time`](#scheduletime), [`schedule.timezone`](#scheduletimezone), [`schedule.day`](#scheduleday).
5458
* Options to control which dependencies are updated: [`allow`](#allow), {% ifversion dependabot-version-updates-groups %}[`groups`](#groups),{% endif %} [`ignore`](#ignore), [`vendor`](#vendor).
5559
* Options to add metadata to pull requests: [`reviewers`](#reviewers), [`assignees`](#assignees), [`labels`](#labels), [`milestone`](#milestone).
@@ -117,6 +121,14 @@ updates:
117121

118122
**Required**. You must define the location of the package manifests for each package manager (for example, the _package.json_ or _Gemfile_). You define the directory relative to the root of the repository for all ecosystems except {% data variables.product.prodname_actions %}.
119123

124+
{% ifversion dependabot-updates-multidirectory-support %}
125+
126+
{% data reusables.dependabot.directories-option-overview %} For more information, see [`directories`](#directories).
127+
128+
{% data reusables.dependabot.directory-directories-required %}
129+
130+
{% endif %}
131+
120132
For {% data variables.product.prodname_actions %}, you do not need to set the directory to `/.github/workflows`. Configuring the key to `/` automatically instructs {% data variables.product.prodname_dependabot %} to search the `/.github/workflows` directory, as well as the _action.yml_ / _action.yaml_ file from the root directory.
121133

122134
```yaml
@@ -143,6 +155,92 @@ updates:
143155
interval: "weekly"
144156
```
145157
158+
{% ifversion dependabot-updates-multidirectory-support %}
159+
160+
### `directories`
161+
162+
**Required**. You must define the locations of the package manifests for each package manager. You define directories relative to the root of the repository for all ecosystems except {% data variables.product.prodname_actions %}. The `directories` option contains a list of strings representing directories.
163+
164+
{% data reusables.dependabot.directory-directories-required %}
165+
166+
```yaml
167+
# Specify locations of manifest files for each package manager using `directories`
168+
169+
version: 2
170+
updates:
171+
- package-ecosystem: "bundler"
172+
directories:
173+
- "/frontend"
174+
- "/backend"
175+
- "/admin"
176+
schedule:
177+
interval: "weekly"
178+
```
179+
180+
{% data reusables.dependabot.directories-option-overview %}
181+
182+
{% data reusables.dependabot.directory-vs-directories-guidance %}
183+
184+
```yaml
185+
# Specify locations of manifest files for each package manager using both `directories` and `directory`
186+
187+
version: 2
188+
updates:
189+
- package-ecosystem: "bundler"
190+
directories:
191+
- "/frontend"
192+
- "/backend"
193+
- "/admin"
194+
schedule:
195+
interval: "weekly"
196+
- package-ecosystem: "bundler"
197+
directory: "/"
198+
schedule:
199+
interval: "daily"
200+
```
201+
202+
>[!TIP]
203+
> The `directories` key supports globbing and the wildcard character `*`. These features are not supported by the `directory` key.
204+
205+
```yaml
206+
# Specify the root directory and directories that start with "lib-", using globbing, for locations of manifest files
207+
208+
version: 2
209+
updates:
210+
- package-ecosystem: "composer"
211+
directories:
212+
- "/"
213+
- "/lib-*"
214+
schedule:
215+
interval: "weekly"
216+
```
217+
218+
```yaml
219+
# Specify the root directory and directories in the root directory as the location of manifest files using the wildcard character
220+
221+
version: 2
222+
updates:
223+
- package-ecosystem: "composer"
224+
directories:
225+
- "*"
226+
schedule:
227+
interval: "weekly"
228+
```
229+
230+
```yaml
231+
# Specify all directories from the current layer and below recursively, using globstar, for locations of manifest files
232+
233+
version: 2
234+
updates:
235+
- package-ecosystem: "composer"
236+
directories:
237+
- "**/*"
238+
schedule:
239+
interval: "weekly"
240+
```
241+
242+
{% endif %}
243+
146244
### `schedule.interval`
147245

148246
**Required**. You must define how often to check for new versions for each package manager. By default, {% data variables.product.prodname_dependabot %} randomly assigns a time to apply all the updates in the configuration file. To set a specific time, you can use [`schedule.time`](#scheduletime) and [`schedule.timezone`](#scheduletimezone).

content/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ You enable {% data variables.product.prodname_dependabot_version_updates %} by c
6464
1. Optionally, if you have dependencies in a private registry, add a `registries` section containing authentication details. For more information, see [`registries`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#registries) in "Configuration options for the `dependabot.yml` file."
6565
1. Add an `updates` section, with an entry for each package manager you want {% data variables.product.prodname_dependabot %} to monitor. This key is mandatory. You use it to configure how {% data variables.product.prodname_dependabot %} updates the versions or your project's dependencies. Each entry configures the update settings for a particular package manager.
6666
1. For each package manager, use:
67+
6768
* `package-ecosystem` to specify the package manager. For more information about the supported package managers, see [`package-ecosystem`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem) in "Configuration options for the `dependabot.yml` file."
6869
* `directory` to specify the location of the manifest or other definition files. For more information, see [`directory`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directory) in "Configuration options for the `dependabot.yml` file."
70+
{% ifversion dependabot-updates-multidirectory-support %}- `directories` to specify the location of multiple manifest or other definition files. For more information, see [`directories`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directories) in "Configuration options for the `dependabot.yml` file."{% endif %}
6971
* `schedule.interval` to specify how often to check for new versions. For more information, see [`schedule.interval`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval) in "Configuration options for the `dependabot.yml` file."
72+
7073
{% data reusables.dependabot.check-in-dependabot-yml %}
7174

7275
### Example `dependabot.yml` file

content/code-security/dependabot/working-with-dependabot/troubleshooting-dependabot-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ The [`groups`](/code-security/dependabot/dependabot-version-updates/configuratio
214214

215215
For grouped security updates, {% data variables.product.prodname_dependabot %} uses the following guidelines to create grouped pull requests.
216216

217-
* {% data variables.product.prodname_dependabot %} **will** group dependencies from the same package ecosystem that are located in different directories. Grouping across directories only occurs for directories not configured in the `dependabot.yml` file.
217+
* {% data variables.product.prodname_dependabot %} **will** group dependencies from the same package ecosystem that are located in different directories when grouping rules are specified for configurations that use the `directories` key.
218218
* {% data variables.product.prodname_dependabot %} **will** apply other relevant customization options from the `dependabot.yml` file to pull requests for grouped security updates. {% data reusables.dependabot.dependabot-grouped-security-updates-yaml-override %}
219219
* {% data variables.product.prodname_dependabot %} **will not** group dependencies from different package ecosystems together.
220220
* {% data variables.product.prodname_dependabot %} **will not** group security updates with version updates.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reference: Issue #13733 - Multidirectory Configuration for Dependabot Version Updates - [Public Beta]
2+
versions:
3+
fpt: '*'
4+
ghec: '*'
5+
ghes: '>3.13'

data/reusables/dependabot/configuration-options.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
| Option | Required | Security Updates | Version Updates | Description |
22
|:---|:---:|:---:|:---:|:---|
33
| [`package-ecosystem`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem) | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | Package manager to use |
4-
| [`directory`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directory) | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | Location of package manifests |
4+
| [`directory`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directory) | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | Location of package manifests |{% ifversion dependabot-updates-multidirectory-support %}
5+
| [`directories`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directories) | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | Locations of package manifests (multiple directories) |{% endif %}
56
| [`schedule.interval`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval) | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | How often to check for updates |
67
| [`allow`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#allow) | {% octicon "x" aria-label="Not supported" %}| {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | Customize which updates are allowed |
78
| [`assignees`](/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#assignees) | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | Assignees to set on pull requests |
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
You can enable grouped pull requests for {% data variables.product.prodname_dependabot_security_updates %} in one, or both, of the following ways.
2+
23
* To group as many available security updates together as possible, across directories and per ecosystem, enable grouping in the "Code security and analysis" settings for your organization or repository.
3-
* For more granular control of grouping, such as grouping by package name, development/production dependencies, or SemVer level, add configuration options to the `dependabot.yml` configuration file in your repository.
4+
* For more granular control of grouping, such as grouping by package name, development/production dependencies,{% ifversion dependabot-updates-multidirectory-support %} SemVer level, or across multiple directories per ecosystem{% else %} or SemVer level{% endif %}, add configuration options to the `dependabot.yml` configuration file in your repository.

data/reusables/dependabot/dependabot-version-updates-groups-yaml-example.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ A `dependabot.yml` file with a customized Bundler configuration, which has been
3333
version: 2
3434
updates:
3535
# Keep bundler dependencies up to date
36-
- package-ecosystem: "bundler"
37-
directory: "/"
36+
- package-ecosystem: "bundler"{% ifversion dependabot-updates-multidirectory-support %}
37+
directories:
38+
- "/frontend"
39+
- "/backend"
40+
- "/admin"{% else %}
41+
directory: "/"{% endif %}
3842
schedule:
3943
interval: "weekly"
4044
# Create a group of dependencies to be updated together in one pull request
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You can use `directories` instead of `directory` to apply the same configuration to a list of multiple directories. The `directory` or `directories` entries must be unique and cannot overlap with the `directory` or `directories` entries in blocks that have the same ecosystem and `target-branch`. You can have one block specifying multiple directories and another block with specifications for one directory only, but both keys can't be present in the same block.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% note %}
2+
3+
**Note:** You cannot use both `directory` and `directories` in the same configuration block. Only one option is required, not both.
4+
5+
{% endnote %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Using `directory`, `directories`, or a mixture of both, are all valid approaches. You should tailor your configuration to your requirements. We recommend you use `directories` when you want to apply the exact same configuration to multiple directories or group dependency updates across multiple directories, and `directory` when you want to apply a configuration to only one directory, or if you want each directory to have a different configuration.

0 commit comments

Comments
 (0)