Skip to content

Commit 46be69f

Browse files
authored
Merge branch 'main' into fix/code_spell_1139
2 parents 9f577fa + 23c5205 commit 46be69f

8 files changed

Lines changed: 50 additions & 8 deletions

File tree

.github/workflows/test-all.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ jobs:
5050
"mcr.microsoft.com/devcontainers/base:debian",
5151
"mcr.microsoft.com/devcontainers/base:noble"
5252
]
53+
exclude:
54+
- features: oryx
55+
baseImage: ubuntu:jammy
56+
- features: oryx
57+
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
58+
- features: docker-in-docker
59+
baseImage: mcr.microsoft.com/devcontainers/base:debian
60+
- features: docker-outside-of-docker
61+
baseImage: mcr.microsoft.com/devcontainers/base:debian
62+
- features: docker-in-docker
63+
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
64+
- features: docker-outside-of-docker
65+
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
5366
steps:
5467
- uses: actions/checkout@v7
5568

@@ -100,6 +113,15 @@ jobs:
100113
- name: "Install latest devcontainer CLI"
101114
run: npm install -g @devcontainers/cli
102115

116+
- name: "Exclude iptables-isolation scenarios from docker-in-docker (run in separate 'iptables-isolation' job)"
117+
if: matrix.features == 'docker-in-docker'
118+
run: |
119+
sudo apt-get update && sudo apt-get install -y jq
120+
sed 's://.*$::' test/docker-in-docker/scenarios.json \
121+
| jq 'del(.docker_with_default_iptables, .docker_with_default_iptables_ubuntu)' \
122+
> test/docker-in-docker/scenarios.json.tmp
123+
mv test/docker-in-docker/scenarios.json.tmp test/docker-in-docker/scenarios.json
124+
103125
- name: "Testing '${{ matrix.features }}' scenarios"
104126
run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated .
105127

.github/workflows/update-aws-cli-completer-scripts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- name: Generate a token
1515
id: app-token
16-
uses: actions/create-github-app-token@v2
16+
uses: actions/create-github-app-token@v3
1717
with:
1818
app-id: ${{ vars.DEVCONTAINERS_REPO_AUTOMATION_ID }}
1919
private-key: ${{ secrets.DEVCONTAINERS_REPO_AUTOMATION_PRIVATE_KEY }}

.github/workflows/update-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- name: Generate a token
1717
id: app-token
18-
uses: actions/create-github-app-token@v2
18+
uses: actions/create-github-app-token@v3
1919
with:
2020
app-id: ${{ vars.DEVCONTAINERS_REPO_AUTOMATION_ID }}
2121
private-key: ${{ secrets.DEVCONTAINERS_REPO_AUTOMATION_PRIVATE_KEY }}

.github/workflows/update-dotnet-install-script.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- name: Generate a token
1515
id: app-token
16-
uses: actions/create-github-app-token@v2
16+
uses: actions/create-github-app-token@v3
1717
with:
1818
app-id: ${{ vars.DEVCONTAINERS_REPO_AUTOMATION_ID }}
1919
private-key: ${{ secrets.DEVCONTAINERS_REPO_AUTOMATION_PRIVATE_KEY }}

src/github-cli/NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ This Feature should work on recent versions of Debian/Ubuntu-based distributions
66

77
## Extensions
88

9-
If you set the `extensions` option, the feature will run `gh extension install` for each entry (comma-separated). Extensions are installed for the most appropriate non-root user (based on `USERNAME` / `_REMOTE_USER`), with a fallback to `root`.
9+
If you set the `extensions` option, the feature will install each comma-separated entry. Extensions are installed for the most appropriate non-root user (based on `USERNAME` / `_REMOTE_USER`), with a fallback to `root`.
10+
11+
Private extensions can be installed when `GH_TOKEN` or `GITHUB_TOKEN` is available during feature installation. The token is forwarded to the selected non-root user and used through the GitHub CLI Git credential helper.

src/github-cli/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "github-cli",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"name": "GitHub CLI",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/github-cli",
66
"description": "Installs the GitHub CLI. Auto-detects latest version and installs needed dependencies.",

src/github-cli/install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,11 @@ if [ -n "${EXTENSIONS}" ]; then
271271
else
272272
EXTENSIONS_ESCAPED="$(printf '%q' "${EXTENSIONS}")"
273273
USERNAME_ESCAPED="$(printf '%q' "${USERNAME}")"
274-
su - "${USERNAME}" -c "EXTENSIONS=${EXTENSIONS_ESCAPED} USERNAME=${USERNAME_ESCAPED} INSTALL_EXTENSIONS=true bash '${EXTENSIONS_SCRIPT}'"
274+
su \
275+
--login \
276+
--whitelist-environment=GH_TOKEN,GITHUB_TOKEN \
277+
--command "EXTENSIONS=${EXTENSIONS_ESCAPED} USERNAME=${USERNAME_ESCAPED} INSTALL_EXTENSIONS=true bash '${EXTENSIONS_SCRIPT}'" \
278+
"${USERNAME}"
275279
INSTALL_EXTENSIONS=false bash "${EXTENSIONS_SCRIPT}"
276280
fi
277281
fi

src/github-cli/scripts/install-extensions.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,32 @@ install_extension() {
2626

2727
mkdir -p "${extensions_root}"
2828
if [ ! -d "${extensions_root}/${repo_name}" ]; then
29-
git clone --depth 1 "https://github.com/${extension}.git" "${extensions_root}/${repo_name}"
29+
git \
30+
-c credential.helper= \
31+
-c credential.helper='!gh auth git-credential' \
32+
clone --depth 1 "https://github.com/${extension}.git" "${extensions_root}/${repo_name}"
3033
fi
3134
}
3235

3336
ensure_gh_extension_list_wrapper() {
37+
local gh_config_dir
38+
3439
if [ "$(id -u)" -ne 0 ]; then
3540
return
3641
fi
3742

38-
if gh extension list >/dev/null 2>&1; then
43+
gh_config_dir="$(mktemp -d)"
44+
if env \
45+
-u GH_TOKEN \
46+
-u GITHUB_TOKEN \
47+
-u GH_ENTERPRISE_TOKEN \
48+
-u GITHUB_ENTERPRISE_TOKEN \
49+
GH_CONFIG_DIR="${gh_config_dir}" \
50+
gh extension list >/dev/null 2>&1; then
51+
rm -rf "${gh_config_dir}"
3952
return
4053
fi
54+
rm -rf "${gh_config_dir}"
4155

4256
cat > /usr/local/bin/gh <<'EOF'
4357
#!/usr/bin/env bash

0 commit comments

Comments
 (0)