fix: dedupe sync paths in git tests
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ import path from 'path';
|
|||||||
import { GITEA_SERVER_URL, GITEA_REPOSITORY, GITEA_TOKEN, PR_HEAD_BRANCH, FINDINGS_PATH } from './config.js';
|
import { GITEA_SERVER_URL, GITEA_REPOSITORY, GITEA_TOKEN, PR_HEAD_BRANCH, FINDINGS_PATH } from './config.js';
|
||||||
|
|
||||||
const remoteUrl = `${GITEA_SERVER_URL.replace(/\/$/, '')}/${GITEA_REPOSITORY}.git`;
|
const remoteUrl = `${GITEA_SERVER_URL.replace(/\/$/, '')}/${GITEA_REPOSITORY}.git`;
|
||||||
const SYNC_PATHS = [
|
export const SYNC_PATHS = [
|
||||||
FINDINGS_PATH,
|
FINDINGS_PATH,
|
||||||
'.amazonq/rules/triage-findings.md',
|
'.amazonq/rules/triage-findings.md',
|
||||||
'.claude/skills/triage-findings/SKILL.md',
|
'.claude/skills/triage-findings/SKILL.md',
|
||||||
|
|||||||
+2
-12
@@ -3,24 +3,14 @@ import assert from 'node:assert/strict';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { commitAndPush, cloneRepo } from './git.js';
|
import { commitAndPush, cloneRepo, SYNC_PATHS } from './git.js';
|
||||||
|
|
||||||
// --- helpers ---
|
// --- helpers ---
|
||||||
function makeTmpWorkspace() {
|
function makeTmpWorkspace() {
|
||||||
const ws = fs.mkdtempSync(path.join(os.tmpdir(), 'git-test-'));
|
const ws = fs.mkdtempSync(path.join(os.tmpdir(), 'git-test-'));
|
||||||
// Pre-create repo dir so clone branch is skipped
|
// Pre-create repo dir so clone branch is skipped
|
||||||
fs.mkdirSync(path.join(ws, 'repo'), { recursive: true });
|
fs.mkdirSync(path.join(ws, 'repo'), { recursive: true });
|
||||||
const files = [
|
for (const relPath of SYNC_PATHS) {
|
||||||
'.gitea/ai-review/findings.json',
|
|
||||||
'.amazonq/rules/triage-findings.md',
|
|
||||||
'.claude/skills/triage-findings/SKILL.md',
|
|
||||||
'.gemini/skills/triage-findings/SKILL.md',
|
|
||||||
'.github/copilot-instructions.md',
|
|
||||||
'.github/skills/triage-findings/SKILL.md',
|
|
||||||
'CLAUDE.md',
|
|
||||||
'GEMINI.md',
|
|
||||||
];
|
|
||||||
for (const relPath of files) {
|
|
||||||
const fullPath = path.join(ws, relPath);
|
const fullPath = path.join(ws, relPath);
|
||||||
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
||||||
fs.writeFileSync(fullPath, relPath);
|
fs.writeFileSync(fullPath, relPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user