patchrelay 0.41.7 → 0.41.8
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.
- package/dist/build-info.json +3 -3
- package/dist/hook-runner.js +18 -1
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/hook-runner.js
CHANGED
|
@@ -8,7 +8,7 @@ export async function runProjectHook(repoPath, hookName, options) {
|
|
|
8
8
|
}
|
|
9
9
|
const result = await execCommand(hookPath, [], {
|
|
10
10
|
cwd: options.cwd,
|
|
11
|
-
env: { ...
|
|
11
|
+
env: { ...sanitizedParentEnv(), ...(options.env ?? {}) },
|
|
12
12
|
timeoutMs: options.timeoutMs ?? 120_000,
|
|
13
13
|
});
|
|
14
14
|
return {
|
|
@@ -18,6 +18,23 @@ export async function runProjectHook(repoPath, hookName, options) {
|
|
|
18
18
|
stderr: result.stderr,
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
// Patchrelay runs as a service with NODE_ENV=production, which makes `npm ci`
|
|
22
|
+
// in a project hook silently omit devDependencies. The subject project's install
|
|
23
|
+
// surface is a separate concern from patchrelay's own runtime, so scrub the
|
|
24
|
+
// variables that would leak patchrelay's production posture into the hook.
|
|
25
|
+
const STRIPPED_PARENT_ENV_VARS = [
|
|
26
|
+
"NODE_ENV",
|
|
27
|
+
"NPM_CONFIG_PRODUCTION",
|
|
28
|
+
"NPM_CONFIG_OMIT",
|
|
29
|
+
"NPM_CONFIG_INCLUDE",
|
|
30
|
+
];
|
|
31
|
+
function sanitizedParentEnv() {
|
|
32
|
+
const env = { ...process.env };
|
|
33
|
+
for (const key of STRIPPED_PARENT_ENV_VARS) {
|
|
34
|
+
delete env[key];
|
|
35
|
+
}
|
|
36
|
+
return env;
|
|
37
|
+
}
|
|
21
38
|
export function buildHookEnv(issueKey, branchName, stage, worktreePath) {
|
|
22
39
|
return {
|
|
23
40
|
PATCHRELAY_ISSUE_KEY: issueKey,
|