@plainconceptsplatform/workflows 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -166,7 +166,8 @@ async function preCommitHookUpdate(repositoryPath) {
|
|
|
166
166
|
if (!await exists(hookPath)) {
|
|
167
167
|
return { target, content: managedLines };
|
|
168
168
|
}
|
|
169
|
-
const content = await readFile(hookPath, "utf8")
|
|
169
|
+
const content = (await readFile(hookPath, "utf8"))
|
|
170
|
+
.replace("pnpm exec if git diff --cached --name-only -- .github | grep -q .; then", "if git diff --cached --name-only -- .github | grep -q .; then");
|
|
170
171
|
if (content.includes("compile-agent-workflows")) {
|
|
171
172
|
const legacyLines = `${compileLine}\n${stageLine}\n${actionLockLine}\n`;
|
|
172
173
|
if (content.includes(managedLines))
|
|
@@ -268,6 +268,14 @@ describe("catalog installation", () => {
|
|
|
268
268
|
await expect(readFile(join(repositoryPath, ".husky", "pre-commit"), "utf8"))
|
|
269
269
|
.resolves.toContain("if git diff --cached --name-only -- .github | grep -q .; then");
|
|
270
270
|
});
|
|
271
|
+
it("repairs a malformed compiler hook prefixed with pnpm exec", async () => {
|
|
272
|
+
const repositoryPath = await createDirectory({
|
|
273
|
+
".husky/pre-commit": "pnpm exec if git diff --cached --name-only -- .github | grep -q .; then\n node scripts/compile-agent-workflows.mjs\n git add -- .github/workflows/*.lock.yml\n [ ! -f .github/actions/actions-lock.json ] || git add -- .github/actions/actions-lock.json\nfi\n",
|
|
274
|
+
});
|
|
275
|
+
await ensurePreCommitHook(repositoryPath);
|
|
276
|
+
await expect(readFile(join(repositoryPath, ".husky", "pre-commit"), "utf8"))
|
|
277
|
+
.resolves.not.toContain("pnpm exec if");
|
|
278
|
+
});
|
|
271
279
|
it("leaves consumer files untouched when staged workflow compilation fails", async () => {
|
|
272
280
|
const sourcePath = await createDirectory({
|
|
273
281
|
"actions/check/action.yml": "package action\n",
|