Add npm scope to publish workflow #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| core-build-test: | |
| name: Core Build and Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/core | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Build | |
| run: npm run build | |
| - name: Smoke test published entrypoint | |
| run: | | |
| node --input-type=module <<'NODE' | |
| import { scan } from './dist/index.js'; | |
| const result = await scan( | |
| { paths: ['a.js'] }, | |
| { | |
| fileResolver: async () => 'eval(atob("YQ=="));\n', | |
| logger: { debug() {}, info() {}, warn() {}, error() {} }, | |
| }, | |
| ); | |
| if (!result.findings.some(f => f.ruleId === 'obf.decode-then-exec.javascript')) { | |
| throw new Error('built package did not load rules and scan successfully'); | |
| } | |
| NODE | |
| - name: Test | |
| run: npm run test:all |