Skip to content

Commit 88c9ace

Browse files
committed
fix: use JSON kind for devcontainer updatecli targets
Switch from file kind with regex patterns to json kind with JSONPath queries for updating Docker and GitHub CLI versions in devcontainer.json. The previous file-based approach failed because the search pattern matched the feature name line, but the version field is on the next line. Using json kind with JSONPath directly targets the correct fields.
1 parent cc96764 commit 88c9ace

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

updatecli/updatecli.d/devcontainer.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,26 @@ targets:
4040
dockerVersion:
4141
name: 'deps(devcontainer): update Docker version'
4242
scmid: default
43-
kind: file
43+
kind: json
4444
sourceid: dockerLatestMinor
4545
spec:
4646
file: .devcontainer/devcontainer.json
47-
matchpattern: '("version": "v?)([0-9.]*)(",)'
48-
replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}'
49-
search:
50-
pattern: 'ghcr\.io/devcontainers/features/docker-in-docker'
47+
key: '$.features."ghcr.io/devcontainers/features/docker-in-docker:2".version'
5148
transformers:
5249
- trimprefix: v
50+
- addprefix: v
5351

5452
githubcliVersion:
5553
name: 'deps(devcontainer): update GitHub CLI version'
5654
scmid: default
57-
kind: file
55+
kind: json
5856
sourceid: githubcliLatestMinor
5957
spec:
6058
file: .devcontainer/devcontainer.json
61-
matchpattern: '("version": "v?)([0-9.]+)(")'
62-
replacepattern: '${1}{{ source "githubcliLatestMinor" }}${3}'
63-
search:
64-
pattern: 'ghcr\.io/devcontainers/features/github-cli'
59+
key: '$.features."ghcr.io/devcontainers/features/github-cli:1".version'
6560
transformers:
6661
- trimprefix: v
62+
- addprefix: v
6763

6864
actions:
6965
default:

0 commit comments

Comments
 (0)