From 9e4851b81d04a0afdb573d378bd572a650126a8a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 2 Dec 2025 07:22:58 +0000 Subject: [PATCH 1/2] fix(ci): bypass AWS profile prompt in CI environment The CI workflow was failing because chezmoi's promptStringOnce was trying to prompt for an AWS profile in a non-interactive environment. Changes: - Add AWS_PROFILE environment variable support to install.sh - Update CI workflow to set AWS_PROFILE="" to bypass the prompt - Document new AWS_PROFILE env var in install.sh help text The AWS_PROFILE variable can be set to an empty string for environments like CI, or to a specific profile name to bypass the interactive prompt during installation. Fixes the error: chezmoi: template: chezmoi.toml:14:19: executing "chezmoi.toml" at : error calling promptStringOnce: could not open a new TTY: open /dev/tty: no such device or address --- .github/workflows/ci.yml | 2 +- install.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ffb509..5e31cab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Install chezmoi run: | - GIT_USER_NAME="CI Test User" GIT_USER_EMAIL="ci@example.com" ./install.sh + GIT_USER_NAME="CI Test User" GIT_USER_EMAIL="ci@example.com" AWS_PROFILE="" ./install.sh - name: Install test dependencies run: | ./bin/setup diff --git a/install.sh b/install.sh index 00cc6a6..f58cc3b 100755 --- a/install.sh +++ b/install.sh @@ -24,6 +24,9 @@ # VERIFY_SIGNATURES: Disable signature verification (default: true) # SKIP_PACKAGE_MANAGER: Force binary download (default: false) # DEBUG: Enable debug output +# GIT_USER_NAME: Git user name (bypasses prompt if set) +# GIT_USER_EMAIL: Git user email (bypasses prompt if set) +# AWS_PROFILE: AWS profile name (bypasses prompt if set, empty string for none) # # EXAMPLE USAGE: # $ git clone https://github.com/ivy/dotfiles.git @@ -116,6 +119,9 @@ ENVIRONMENT VARIABLES: VERIFY_SIGNATURES Disable signature verification (default: true) SKIP_PACKAGE_MANAGER Force binary download (default: false) DEBUG Enable debug output + GIT_USER_NAME Git user name (bypasses prompt if set) + GIT_USER_EMAIL Git user email (bypasses prompt if set) + AWS_PROFILE AWS profile name (bypasses prompt if set, use empty string for none) EXAMPLES: ./install.sh # Install normally @@ -691,6 +697,10 @@ main() { if [ -n "${GIT_USER_EMAIL:-}" ]; then set -- "$@" --promptString "Git user.email=$GIT_USER_EMAIL" fi + # Handle AWS_PROFILE - can be set to empty string to bypass prompt in CI + if [ -n "${AWS_PROFILE+x}" ]; then + set -- "$@" --promptString "aws_profile=$AWS_PROFILE" + fi # Add any additional passthrough arguments if [ -n "$CHEZMOI_ARGS" ]; then From 0b46d59bee7a5de808082084ada0174d86c5263d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 2 Dec 2025 07:42:35 +0000 Subject: [PATCH 2/2] fix(ci): configure npm to avoid permission errors The CI was failing with EACCES errors when npm tried to create directories in /usr/local/share/man/man7. This happened because when mise installs Node.js, npm attempts to set up global directories that require root permissions. Changes: - Add .npmrc to configure npm to use local directories - Set npm prefix to ~/.local/npm-global to avoid permission issues - Disable global package installations and install-links - Add bun install step to CI workflow to install dependencies This repository uses bun for package management (per CLAUDE.md), so npm should not be used directly. The .npmrc ensures that if npm is invoked, it won't try to write to global directories. --- .github/workflows/ci.yml | 3 +++ .npmrc | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .npmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9984221..1906476 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,9 @@ jobs: - name: Install test dependencies run: | ./bin/setup + - name: Install package dependencies + run: | + bun install - name: Run test suite run: | ./bin/test diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..4caddc9 --- /dev/null +++ b/.npmrc @@ -0,0 +1,15 @@ +# npm configuration for dotfiles repository +# This repository uses bun for package management - npm should not be used directly + +# Prevent npm from trying to write to global directories +# This is especially important in CI environments without root access +global=false + +# Use local prefix to avoid permission issues +prefix=${HOME}/.local/npm-global + +# Disable automatic installation of global packages +install-links=false + +# Disable update notifier in CI +update-notifier=false