Skip to content

Commit 4d6265e

Browse files
robaikenCopilotAbhishekBhaskaram-stead
authored
Add pre-commit support to Dependabot configuration and documentation (#59794)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Abhishek <abhishekbhaskar@github.com> Co-authored-by: Anne-Marie <102995847+am-stead@users.noreply.github.com>
1 parent efed051 commit 4d6265e

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

content/code-security/reference/supply-chain-security/dependabot-options-reference.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ Package manager | YAML value | Supported versions |
551551
| pipenv | `pip` | <= 2024.4.1 |
552552
| pnpm | `npm` | v7, v8 <br>v9, v10 (version updates only) |
553553
| poetry | `pip` | v2 |
554+
| {% ifversion dependabot-pre-commit-support %} |
555+
| pre-commit | `pre-commit` | Not applicable |
556+
| {% endif %} |
554557
| pub | `pub` | v2 |
555558
| {% ifversion dependabot-rust-toolchain-support %} |
556559
| Rust toolchain | `rust-toolchain` | Not applicable |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reference: #16918
2+
# pre-commit support for Dependabot
3+
versions:
4+
fpt: '*'
5+
ghec: '*'
6+
ghes: '> 3.20'

data/reusables/dependabot/supported-package-managers.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pipenv | `pip` | <= 2021-05-29 | {% octicon "check" aria-l
4343
[pip-compile](#pip-and-pip-compile) | `pip` | 6.1.0 | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} |
4444
| {% ifversion dependabot-updates-pnpmv9-support %}pnpm{% else %}[pnpm](#pnpm){% endif %} | `npm` | v7, v8, v9, v10 | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} {% ifversion dependabot-updates-pnpmv9-support %}{% else %}(v7 and v8 only){% endif %}| {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} |
4545
poetry | `pip` | v1 | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} |
46+
| {% ifversion dependabot-pre-commit-support %} |
47+
[pre-commit](#pre-commit) | `pre-commit` | Not applicable | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} |
48+
| {% endif %} |
4649
[pub](#pub) | `pub` | v2 | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} |
4750
| {% ifversion dependabot-rust-toolchain-support %} |
4851
[Rust toolchain](#rust-toolchain) | `rust-toolchain` | Not applicable | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | Not applicable | Not applicable |
@@ -183,6 +186,30 @@ pnpm is supported for {% data variables.product.prodname_dependabot_version_upda
183186

184187
The PEP 621 `project` section isn't currently supported for `poetry`.
185188

189+
{% ifversion dependabot-pre-commit-support %}
190+
191+
### pre-commit
192+
193+
{% data variables.product.prodname_dependabot %} can update hook revisions in `.pre-commit-config.yaml` files. When a hook pins a specific commit SHA, {% data variables.product.prodname_dependabot %} resolves the latest matching tag and updates the `rev` value accordingly.
194+
195+
You can use a `# frozen:` comment after the `rev` value to pin a hook to a particular version or version prefix. {% data variables.product.prodname_dependabot %} uses this comment to determine whether an update is needed and which tag to resolve.
196+
197+
| Scenario | Behavior |
198+
|---|---|
199+
| `rev: <sha> # frozen: 7.3.0` and 7.3.0 is the latest version | No update. The dependency is already current. |
200+
| `rev: <sha> # frozen: 7.3.0` and 8.0.0 has been released | Updated to the SHA for the `8.0.0` tag. The comment is updated to `# frozen: 8.0.0`. |
201+
| `rev: <sha> # frozen: v1` and `v1.43.5` is the latest `v1.x` release | Updated to the SHA for the `v1.43.5` tag. The comment is updated to `# frozen: v1.43.5`. |
202+
| `rev: <sha>` with no `# frozen:` comment | Updated to the HEAD SHA of the default branch. |
203+
204+
In addition to updating hook revisions, {% data variables.product.prodname_dependabot %} can update `additional_dependencies` for hooks that use the following languages: Python, Node, Go, Rust, Ruby and Dart.
205+
206+
Private registry support uses git registries. You can configure access for private git repositories by specifying a git registry in your `dependabot.yml` file. For more information, see [AUTOTITLE](/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot#git).
207+
208+
> [!NOTE]
209+
> Private registries are not supported for `additional_dependencies`.
210+
211+
{% endif %}
212+
186213
{% ifversion dependabot-rust-toolchain-support %}
187214

188215
### Rust toolchain

0 commit comments

Comments
 (0)