feat(github-cli): support private extension installs (#1705) · devcontainers/features@8b03a98 · GitHub
Skip to content

Commit 8b03a98

Browse files
feat(github-cli): support private extension installs (#1705)
Co-authored-by: Kaniska <kaniska244@github.com>
1 parent c6f2fbd commit 8b03a98

4 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎src/github-cli/NOTES.md‎

Lines changed: 3 additions & 1 deletion

‎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

0 commit comments

Comments
 (0)