feat: force sync skill trees
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user