From f017fec8f506ad18ded4826d9c6193ad3f54511e Mon Sep 17 00:00:00 2001 From: emil Date: Mon, 6 Jul 2026 11:41:04 +0200 Subject: [PATCH] DEVX-118: fix: configure git identity before commit in sync_wiki CI environments may lack git user.email/user.name config, causing git commit to fail with exit code 128. Set identity explicitly before committing wiki changes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- src/devx/ci/sync_wiki.py | 14 +++++++++++++- tests/unit/test_sync_wiki.py | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/devx/ci/sync_wiki.py b/src/devx/ci/sync_wiki.py index 347ee49..ab69ac7 100644 --- a/src/devx/ci/sync_wiki.py +++ b/src/devx/ci/sync_wiki.py @@ -208,7 +208,19 @@ def commit_and_push(wiki_dir: Path, wiki_url: str, dry_run: bool) -> bool: click.echo(_("No changes to sync — wiki is up to date.")) return False - # Commit + # Commit — ensure git identity is configured (CI environments may lack it) + subprocess.run( # nosec + ["git", "config", "user.email", "devin-ai-integration[bot]@users.noreply.github.com"], + cwd=wiki_dir, + capture_output=True, + check=True, + ) + subprocess.run( # nosec + ["git", "config", "user.name", "Devin CI"], + cwd=wiki_dir, + capture_output=True, + check=True, + ) subprocess.run( # nosec ["git", "commit", "-m", "Sync wiki from docs/ [skip ci]"], cwd=wiki_dir, diff --git a/tests/unit/test_sync_wiki.py b/tests/unit/test_sync_wiki.py index b776cec..9a6cfe1 100644 --- a/tests/unit/test_sync_wiki.py +++ b/tests/unit/test_sync_wiki.py @@ -208,6 +208,8 @@ class TestCommitAndPush: mock_run.side_effect = [ MagicMock(returncode=0), # git add MagicMock(returncode=1), # git diff --cached --quiet (has changes) + MagicMock(returncode=0), # git config user.email + MagicMock(returncode=0), # git config user.name MagicMock(returncode=0), # git commit MagicMock(returncode=0, stdout="", stderr=""), # git push ] @@ -219,6 +221,8 @@ class TestCommitAndPush: mock_run.side_effect = [ MagicMock(returncode=0), # git add MagicMock(returncode=1), # git diff --cached --quiet (has changes) + MagicMock(returncode=0), # git config user.email + MagicMock(returncode=0), # git config user.name MagicMock(returncode=0), # git commit MagicMock(returncode=1, stdout="", stderr="push failed"), # git push ]