chore: skip ai review bot commits
This commit is contained in:
+10
-1
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import { commitAndPush, cloneRepo, SYNC_PATHS, BOT_COMMIT_MARKER } from './git.js';
|
||||
import { commitAndPush, cloneRepo, SYNC_PATHS, BOT_COMMIT_MARKER, getHeadCommitMessage, isBotAutoCommit } from './git.js';
|
||||
|
||||
// --- helpers ---
|
||||
function makeTmpWorkspace() {
|
||||
@@ -241,4 +241,13 @@ describe('cloneRepo', () => {
|
||||
const result = cloneRepo(workspace, spawn);
|
||||
assert.equal(result, path.join(workspace, 'repo'));
|
||||
});
|
||||
|
||||
it('reads head commit message and detects bot auto commits', () => {
|
||||
const spawn = makeSpawn({
|
||||
show: () => ({ status: 0, stdout: `chore: update ai-review findings ${BOT_COMMIT_MARKER}\n`, stderr: '', error: null }),
|
||||
});
|
||||
|
||||
assert.ok(getHeadCommitMessage(workspace, spawn).includes(BOT_COMMIT_MARKER));
|
||||
assert.equal(isBotAutoCommit(workspace, spawn), true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user