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 ]