Skip to content

Commit 6c961bf

Browse files
authored
Add Dependabot guide (devcontainers#342)
* dependabot * Update 2024-01-23-dependabot.md
1 parent f69998d commit 6c961bf

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

_posts/2024-01-23-dependabot.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
layout: post
3+
title: "General Availability of Dependabot Integration"
4+
author:
5+
- "@joshspicer"
6+
authorUrl:
7+
- https://github.com/joshspicer
8+
---
9+
10+
We are excited to announce that starting today, in collaboration with the Dependabot Team, the `devcontainers` package ecosystem is now generally available!
11+
Dependabot will now be able to update your public Dev Container [Features](https://containers.dev/features), keeping them up-to-date with the latest published versions.
12+
13+
To opt-in, add a `.github/dependabot.yml` to a repository containing one or more `devcontainer.json` configuration files:
14+
15+
```yaml
16+
# To get started with Dependabot version updates, you'll need to specify which
17+
# package ecosystems to update and where the package manifests are located.
18+
# Please see the documentation for all configuration options:
19+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
20+
21+
version: 2
22+
updates:
23+
- package-ecosystem: "devcontainers" # See documentation for possible values
24+
directory: "/"
25+
schedule:
26+
interval: weekly
27+
```
28+
29+
Once configured, Dependabot will begin to create pull requests to update your Dev Container Features:
30+
31+
32+
<div style="display: flex; justify-content: center;">
33+
<img style="max-width: 100%; height: auto;" src="/img/dependabot-pr.png" alt="Dependabot PR">
34+
</div>
35+
36+
An example diff generated by Dependabot is shown below:
37+
38+
```diff
39+
---
40+
.devcontainer-lock.json | 8 ++++----
41+
.devcontainer.json | 2 +-
42+
2 files changed, 5 insertions(+), 5 deletions(-)
43+
44+
diff --git a/.devcontainer-lock.json b/.devcontainer-lock.json
45+
index 324582b..a3868d9 100644
46+
--- a/.devcontainer-lock.json
47+
+++ b/.devcontainer-lock.json
48+
@@ -1,9 +1,9 @@
49+
{
50+
"features": {
51+
- "ghcr.io/devcontainers/features/docker-in-docker:1": {
52+
- "version": "1.0.9",
53+
- "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:b4c04ba88371a8ec01486356cce10eb9fe8274627d8d170aaec87ed0d333080d",
54+
- "integrity": "sha256:b4c04ba88371a8ec01486356cce10eb9fe8274627d8d170aaec87ed0d333080d"
55+
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {
56+
+ "version": "2.7.1",
57+
+ "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6",
58+
+ "integrity": "sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6"
59+
}
60+
}
61+
}
62+
\ No newline at end of file
63+
diff --git a/.devcontainer.json b/.devcontainer.json
64+
index e9d9af5..9eb9165 100644
65+
--- a/.devcontainer.json
66+
+++ b/.devcontainer.json
67+
@@ -1,6 +1,6 @@
68+
{
69+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
70+
"features": {
71+
- "ghcr.io/devcontainers/features/docker-in-docker:1": {}
72+
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {}
73+
}
74+
}
75+
```
76+
77+
This updater ensures publicly-accessible Features are pinned to the latest version in the associated `devcontainer.json` file. If a dev container has an associated lockfile, that file will also be updated. For more information on lockfiles, see this [specification](https://github.com/devcontainers/spec/blob/main/docs/specs/devcontainer-lockfile.md).
78+
79+
Features in any [valid dev container location](https://containers.dev/implementors/spec/#devcontainerjson) will be updated in a single pull request.
80+
81+
Dependabot version updates are free to use for all repositories on GitHub.com. For more information [see the Dependabot version update documentation](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates#supported-repositories-and-ecosystem).

img/dependabot-pr.png

95.1 KB
Loading

0 commit comments

Comments
 (0)