From 3c9dc96e554ae7e07e8f7128fe66f6f72bdfcc38 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:13:02 +0000 Subject: [PATCH 1/4] Initial plan From a9d01d3b891862f1fe4ae128b4b0814416210aba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:16:02 +0000 Subject: [PATCH 2/4] Add GitHub Actions workflow to validate chezmoi configuration Co-authored-by: verlihirsh <6280012+verlihirsh@users.noreply.github.com> --- .github/workflows/ci.yml | 97 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c6b9d16 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,97 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + validate-chezmoi: + name: Validate chezmoi configuration + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install chezmoi + run: | + sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin + chezmoi --version + + - name: Initialize chezmoi with test data + run: | + # Create a test config directory + export CHEZMOI_SOURCE_DIR="${{ github.workspace }}/home" + export CHEZMOI_DEST_DIR="/tmp/chezmoi-test-dest" + + # Create test .chezmoi.toml.yaml with all required variables + mkdir -p ~/.config/chezmoi + cat > ~/.config/chezmoi/chezmoi.toml << EOF + [data] + name = "CI Test User" + email = "ci@example.com" + editor = "vim" + installZsh = false + installPython = false + installNode = false + installNeovim = false + installCliTools = false + installTmux = false + installDirenv = false + installLspServers = false + installOpencode = false + installNerdFonts = false + installStarship = false + opencodeClaudeMax = false + opencodeClaude = false + opencodeChatgpt = false + opencodeGemini = false + pythonVersion = "3.12" + nodeVersion = "22" + secretsPath = "" + generateSshKey = false + sshKeyType = "ed25519" + + [git] + autoCommit = false + autoPush = false + EOF + + - name: Validate template syntax + run: | + # Initialize chezmoi with the source directory + chezmoi init --source="${{ github.workspace }}/home" + + # Execute templates to validate syntax (dry-run) + echo "Validating template syntax..." + chezmoi execute-template < /dev/null || true + + # Try to apply in dry-run mode to validate all templates + echo "Running chezmoi apply --dry-run to validate configuration..." + chezmoi apply --dry-run --verbose + + - name: Verify chezmoi data + run: | + echo "Verifying chezmoi data variables..." + chezmoi data + + - name: Check for template errors + run: | + echo "Checking for common template issues..." + + # Check for undefined variables in templates + if grep -r "{{.*undefined.*}}" "${{ github.workspace }}/home" --include="*.tmpl" 2>/dev/null; then + echo "::error::Found undefined variables in templates" + exit 1 + fi + + # Validate .chezmoiignore syntax + if [ -f "${{ github.workspace }}/.chezmoiignore" ]; then + echo "Validating .chezmoiignore..." + cat "${{ github.workspace }}/.chezmoiignore" + fi + + echo "✅ All checks passed!" From f78cf3c5a346d27f119aecaa0a1fdb5206364d61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:17:40 +0000 Subject: [PATCH 3/4] Improve CI workflow based on code review feedback Co-authored-by: verlihirsh <6280012+verlihirsh@users.noreply.github.com> --- .github/workflows/ci.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6b9d16..031c8c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,10 +65,6 @@ jobs: # Initialize chezmoi with the source directory chezmoi init --source="${{ github.workspace }}/home" - # Execute templates to validate syntax (dry-run) - echo "Validating template syntax..." - chezmoi execute-template < /dev/null || true - # Try to apply in dry-run mode to validate all templates echo "Running chezmoi apply --dry-run to validate configuration..." chezmoi apply --dry-run --verbose @@ -78,20 +74,6 @@ jobs: echo "Verifying chezmoi data variables..." chezmoi data - - name: Check for template errors + - name: Summary run: | - echo "Checking for common template issues..." - - # Check for undefined variables in templates - if grep -r "{{.*undefined.*}}" "${{ github.workspace }}/home" --include="*.tmpl" 2>/dev/null; then - echo "::error::Found undefined variables in templates" - exit 1 - fi - - # Validate .chezmoiignore syntax - if [ -f "${{ github.workspace }}/.chezmoiignore" ]; then - echo "Validating .chezmoiignore..." - cat "${{ github.workspace }}/.chezmoiignore" - fi - - echo "✅ All checks passed!" + echo "✅ All chezmoi configuration checks passed!" From a9f7a09dbb8b48faffe26ed2a0eb0444b377a330 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:19:08 +0000 Subject: [PATCH 4/4] Add explicit permissions to workflow for security Co-authored-by: verlihirsh <6280012+verlihirsh@users.noreply.github.com> --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 031c8c7..768a529 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: validate-chezmoi: name: Validate chezmoi configuration runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout repository