You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-security/how-tos/secure-your-supply-chain/manage-your-dependency-security/customizing-dependabot-security-prs.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,11 +76,11 @@ To **track progress** towards a project goal or release, use `milestone` to asso
76
76
77
77
For detailed guidance, see [Associating pull requests with a milestone](/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs#associating-pull-requests-with-a-milestone).
78
78
79
-
## Changing the separator in the pull request branch name
79
+
## Customizing pull request branch names
80
80
81
-
To ensure your **branch names align** with your team's existing conventions, use `pull-request-branch-name.separator` to specify the separator you want {% data variables.product.prodname_dependabot %} to use for branch names.
81
+
To ensure your **branch names align** with your team's existing conventions, use `pull-request-branch-name` to customize how {% data variables.product.prodname_dependabot %} generates branch names—including the separator, prefix, length, casing, and format.
82
82
83
-
For detailed guidance, see [Changing the separator in the pull request branch name](/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs#changing-the-separator-in-the-pull-request-branch-name).
83
+
For detailed guidance, see [Customizing pull request branch names](/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs#customizing-pull-request-branch-names).
84
84
85
85
## Example 1: configuration for security updates only
Configure how {% data variables.product.prodname_dependabot %} generates branch names for pull requests. You can customize the separator, prefix, length, casing, word separator, and provide a custom template. For examples, see [AUTOTITLE](/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs).
629
+
630
+
{% data variables.product.prodname_dependabot %} default behavior:
631
+
632
+
* Generate branch names of the form: `dependabot/PACKAGE-MANAGER/DEPENDENCY`
633
+
634
+
| Parameter | Type | Default | Description |
635
+
|-----------|------|---------|-------------|
636
+
| [`separator`](#separator) | String | `"/"` | Character used between segments of the branch name. |
637
+
| [`prefix`](#prefix) | String (max 50 characters) | `"dependabot"` | String prepended to the branch name. |
638
+
| [`max-length`](#max-length) | Integer (20–244) | `100` | Maximum character length of the branch name. |
639
+
| [`word-separator`](#word-separator) | String | Not set | Character to replace underscores (`_`) in branch name content after the prefix. |
640
+
| [`branch-name-case`](#branch-name-case) | String | Not set | Apply case transformation to the branch name content after the prefix. |
641
+
| [`template`](#template) | String (max 200 characters) | Not set | Custom format template using placeholders. |
642
+
643
+
All options are composable. When `template` is set alongside simple options, the processing order is:
644
+
645
+
1. Template rendering (placeholder substitution)
646
+
1. Separator replacement (`/` replaced with configured separator)
647
+
1. Word-separator replacement (`_` replaced with configured word-separator)
648
+
1. Case transformation applied to content after the prefix
649
+
1. Max-length truncation
650
+
651
+
### `separator`
652
+
653
+
Specify a character to use in place of `/` between branch name segments.
654
+
655
+
Supported values: `"-"`, `_`, `/`
656
+
657
+
For example, with `separator: "-"`: `dependabot/npm_and_yarn/lodash-4.17.21` becomes `dependabot-npm_and_yarn-lodash-4.17.21`.
658
+
659
+
> [!TIP]
660
+
> The hyphen symbol must be escaped so it is not interpreted as starting an empty YAML list.
661
+
662
+
### `prefix`
663
+
664
+
Specify a custom string to use at the start of the branch name instead of the default `dependabot`.
665
+
666
+
The value can be up to 50 characters.
667
+
668
+
For example, with `prefix: "deps"`: `dependabot/npm_and_yarn/lodash-4.17.21` becomes `deps/npm_and_yarn/lodash-4.17.21`.
669
+
670
+
### `max-length`
671
+
672
+
Set the maximum allowed length for generated branch names.
673
+
674
+
* Minimum value: `20`.
675
+
* Maximum value: `244`.
676
+
* Default value: `100`.
677
+
* When a branch name exceeds this limit, it is truncated and a hash suffix is appended to preserve uniqueness.
678
+
679
+
For example, with `max-length: 40`, a branch name like `dependabot/npm_and_yarn/some-long-dependency-name-1.0.0` is truncated to 40 characters with a hash suffix.
680
+
681
+
### `word-separator`
682
+
683
+
Specify a character to replace underscores (`_`) in all branch name content after the prefix—including package manager names, dependency names, group names, and directory paths.
684
+
685
+
For example, with `word-separator: "-"`:
686
+
687
+
* `npm_and_yarn` → `npm-and-yarn`
688
+
* `front_end_dir` → `front-end-dir`
689
+
690
+
### `branch-name-case`
691
+
692
+
Apply a case transformation to the branch name content after the prefix.
693
+
694
+
Supported values: `"lowercase"`, `"uppercase"`
695
+
696
+
For example, with `branch-name-case: "lowercase"`: `dependabot/npm_and_yarn/Lodash-4.17.21` becomes `dependabot/npm_and_yarn/lodash-4.17.21`.
697
+
698
+
### `template`
699
+
700
+
Define a custom branch name format using placeholders. The template gives you full control over the structure of generated branch names. For examples, see [AUTOTITLE](/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs).
701
+
702
+
Available placeholders depend on the update strategy:
703
+
704
+
| Placeholder | Solo updates | Grouped updates | Multi-ecosystem groups | Description |
| `{dependency}` | {% octicon "check" aria-label="Available" %} | {% octicon "x" aria-label="Not available" %} | {% octicon "x" aria-label="Not available" %} | The dependency name(s). |
711
+
| `{version}` | {% octicon "check" aria-label="Available" %} | {% octicon "x" aria-label="Not available" %} | {% octicon "x" aria-label="Not available" %} | The new version or ref. |
712
+
| `{group_name}` | {% octicon "x" aria-label="Not available" %} | {% octicon "check" aria-label="Available" %} | {% octicon "check" aria-label="Available" %} | The configured group name. |
713
+
| `{name}` | {% octicon "check" aria-label="Available" %} | {% octicon "check" aria-label="Available" %} | {% octicon "check" aria-label="Available" %} | Strategy-appropriate name: dependency and version for solo updates, group name for grouped updates. |
714
+
715
+
Template validation rules:
716
+
717
+
* All placeholders must be recognized and allowed for the update strategy in use.
718
+
* Braces must be well-formed (no unclosed `{` or `}`).
719
+
* Using `{package_manager}` in a multi-ecosystem group template raises a validation error because no single package manager applies.
720
+
* The rendered branch name must be a valid Git reference name. Characters such as spaces, `~`, `^`, `:`, `?`, `*`, `[`, and `\` are not allowed, and sequences like `..` or `@{` are rejected.
721
+
* For grouped and multi-ecosystem updates, a 10-character digest is automatically appended to the branch name to guarantee uniqueness. This is not user-controlled.
722
+
723
+
{% else %}
625
724
626
725
Specify a separator to use when generating branch names. For examples, see [AUTOTITLE](/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs).
627
726
@@ -633,11 +732,13 @@ When `pull-request-branch-name.separator` is defined:
633
732
634
733
* Use the specified character in place of `/`.
635
734
636
-
Supported values: `"-"`, `_`, `/`
735
+
Supported values: `"-"`, `_`, `/`
637
736
638
737
> [!TIP]
639
738
> The hyphen symbol must be escaped so it is not interpreted as starting an empty YAML list.
Copy file name to clipboardExpand all lines: content/code-security/tutorials/secure-your-dependencies/customizing-dependabot-prs.md
+123-4Lines changed: 123 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,11 +212,131 @@ updates:
212
212
213
213
See also [`milestone`](/code-security/reference/supply-chain-security/dependabot-options-reference#milestone--) and [AUTOTITLE](/issues/using-labels-and-milestones-to-track-work/about-milestones).
214
214
215
-
## Changing the separator in the pull request branch name
215
+
## Customizing pull request branch names
216
216
217
217
{% data variables.product.prodname_dependabot %} generates a branch for each pull request. Each branch name includes `dependabot`, as well as the name of the package manager and the dependency to be updated. By default, these parts of the branch name are separated by a `/` symbol, for example:
218
218
* `dependabot/npm_and_yarn/next_js/acorn-6.4.1`
219
219
220
+
{% ifversion dependabot-branch-name-options %}
221
+
222
+
You can customize branch names using the `pull-request-branch-name` option with the following parameters: `separator`, `prefix`, `max-length`, `word-separator`, `branch-name-case`, and `template`. All options are composable, and you can combine any of them. For the full reference of each parameter, see [`pull-request-branch-name`](/code-security/reference/supply-chain-security/dependabot-options-reference#pull-request-branch-name--).
223
+
224
+
### Combining formatting options
225
+
226
+
You can combine `separator`, `word-separator`, `branch-name-case`, `max-length`, and `template` to produce branch names that meet your system's requirements. For example, Docker tag compatibility, Azure Container Registry naming, or Kubernetes branch length limits.
227
+
228
+
When `template` is set alongside other options, formatting is applied as post-processing after template rendering in this order: separator replacement, word-separator replacement, case transformation, then max-length truncation.
> * The `pull-request-branch-name` on the `multi-ecosystem-groups` entry controls the grouped cross-ecosystem PR branch name.
328
+
> * Individual `updates` entries that specify `multi-ecosystem-group` **cannot** have their own `pull-request-branch-name`. The group-level configuration takes precedence and is the only one used for those entries.
329
+
> * `{package_manager}` is not available in multi-ecosystem group templates because the group spans multiple ecosystems.
330
+
> * A content digest is always auto-appended to multi-ecosystem group branches to guarantee uniqueness.
331
+
332
+
### How branch name configuration applies
333
+
334
+
* **Configuration is per-update entry**: Each standalone `package-ecosystem` entry can have its own branch name configuration. Entries assigned to a multi-ecosystem group use the group-level configuration instead.
335
+
* **Existing PRs are not affected**: Changes only apply to newly created PRs.
336
+
* **Default behavior is unchanged**: If you don't configure any options, branch names remain exactly as they are today.
337
+
338
+
{% else %}
339
+
220
340
To maintain supportability or consistency with your existing processes, you may need to ensure your branch names align with your team's existing conventions. In this case, you can use `pull-request-branch-name.separator` to specify a different separator, choosing either `_`, `/`, or `"-"`.
221
341
222
342
In the below example, the npm configuration changes the default separator from `/` to `"-"`, so that it would appear as such:
@@ -235,13 +355,12 @@ updates:
235
355
schedule:
236
356
interval: "weekly"
237
357
pull-request-branch-name:
238
-
# Change the default separator (/) to a hyphen (-)
239
358
separator: "-"
240
359
```
241
360
242
-
{% data reusables.dependabot.option-affects-security-updates %}
361
+
{% endif %}
243
362
244
-
See also [`pull-request-branch-name.separator`](/code-security/reference/supply-chain-security/dependabot-options-reference#pull-request-branch-nameseparator--).
363
+
{% data reusables.dependabot.option-affects-security-updates %}
245
364
246
365
## Targeting pull requests against a non-default branch
0 commit comments