feat: force sync skill trees

This commit is contained in:
2026-05-18 02:48:54 +00:00
parent 1129f37384
commit b51ab78a5e
2 changed files with 52 additions and 4 deletions
+15
View File
@@ -166,6 +166,21 @@ describe('commitAndPush', () => {
assert.equal(fs.readFileSync(path.join(repoDir, 'CLAUDE.md'), 'utf8'), 'CLAUDE.md');
});
it('recursively overwrites skill tree files from the action source', async () => {
const repoDir = path.join(workspace, 'repo');
const nestedRelPath = '.codex/skills/triage-findings/assets/example.txt';
const sourceNestedPath = path.join(sourceRoot, nestedRelPath);
const repoNestedPath = path.join(repoDir, nestedRelPath);
fs.mkdirSync(path.dirname(sourceNestedPath), { recursive: true });
fs.writeFileSync(sourceNestedPath, 'fresh');
fs.mkdirSync(path.dirname(repoNestedPath), { recursive: true });
fs.writeFileSync(repoNestedPath, 'stale');
await commitAndPush(workspace, repoDir, makeSpawn(), sourceRoot);
assert.equal(fs.readFileSync(repoNestedPath, 'utf8'), 'fresh');
});
it('does not throw when git command fails', async () => {
const failSpawn = () => ({ status: 1, stdout: '', stderr: 'fatal: error', error: null });
await assert.doesNotReject(() => commitAndPush(workspace, path.join(workspace, 'repo'), failSpawn, sourceRoot));