diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34cdcd8..d52c1c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,9 +103,7 @@ jobs: scope: '@mitre-attack' - name: Install dependencies - run: npm clean-install --omit=dev - env: - HUSKY: '0' # Disable Husky installation + run: npm clean-install - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies run: npm audit signatures diff --git a/.husky/install.mjs b/.husky/install.mjs new file mode 100644 index 0000000..0bf841c --- /dev/null +++ b/.husky/install.mjs @@ -0,0 +1,6 @@ +// Skip Husky install in production and CI +if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') { + process.exit(0); +} +const husky = (await import('husky')).default; +console.log(husky()); \ No newline at end of file diff --git a/package.json b/package.json index 86fb419..c7d81d1 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "test:interactive": "vitest", "export": "npm pack", "clean": "rm -rf test/**/*.js test/**/*.js.map test/**/*.d.ts test/**/*.ts.map src/**/*.js src/**/*.js.map src/**/*.d.ts", - "prepare": "husky", + "prepare": "node .husky/install.mjs", "lint": "npx eslint src", "lint:fix": "npm run lint -- --fix", "prettier": "npx prettier src --check",