diff --git a/report.js b/report.js index 4ee5864..91650f9 100644 --- a/report.js +++ b/report.js @@ -263,9 +263,12 @@ async function reportPostInstall () { return Promise.reject(new Error('No parent found, nothing to report')) } - const gitSha = await getGitSha() - logIfVerbose(`Injecting sha to parent: ${gitSha}`) - dependencyInfo.parent.gitSha = gitSha + + if (allowTopLevel(dependencyInfo.rootPackage)) { + const gitSha = await getGitSha() + logIfVerbose(`Injecting sha to parent: ${gitSha}`) + dependencyInfo.parent.gitSha = gitSha + } const rootPackage = dependencyInfo.rootPackage