Skip to content

Commit ad589f0

Browse files
committed
fix(ci): author the evangeliser npm-bun-blocker — it never ran once
The previous file contained a literal BACKSPACE byte (0x08) inside a regex. YAML forbids control characters, so the file never loaded and this "blocker" never executed in its entire history - while every scanner reported it clean (the invisible-character linter could not see control characters until empty-linter#70). Removing the byte exposed further structural YAML errors beneath, so per the owner's ruling it is REWRITTEN against the corrected estate template rather than patched: rejects npm/pnpm/yarn lockfiles, allows Bun (tier 1) and .npmrc (Bun reads it for private-registry auth), top-level permissions, timeout, concurrency. CONTROLS, run before commit: yq parses the file (the old one could not) zero control characters clean dir -> exit 0 package-lock.json-> exit 1 ✅ actually blocks bun.lock + .npmrc-> exit 0 ✅ does not block Bun Folded into this sweep PR deliberately: once empty-linter enforcement lands on this branch, the old file would have turned the repo's own gate red. Fixing it in the same PR keeps the ordering safe.
1 parent 93d201e commit ad589f0

1 file changed

Lines changed: 30 additions & 43 deletions

File tree

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,38 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
name: npm/bun Blocker
3-
on: [push, pull_request]
2+
#
3+
# Authored replacement, 2026-08-28. The previous file contained a literal
4+
# backspace byte (0x08) inside a regex, which made the YAML unloadable - so
5+
# this workflow NEVER RAN in its entire history, while reporting nothing.
6+
# Removing the byte exposed further structural errors, so it was rewritten
7+
# against the corrected estate template rather than patched.
8+
name: npm/pnpm/yarn Blocker
9+
on:
10+
push:
11+
branches: [main]
12+
pull_request:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
421
jobs:
522
check:
623
runs-on: ubuntu-latest
24+
timeout-minutes: 10
25+
permissions:
26+
contents: read
727
steps:
8-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
9-
10-
- name: Check for npm/bun usage in new files
28+
- uses: actions/checkout@v7.0.1
29+
- name: Block npm/pnpm/yarn lockfiles
1130
run: |
12-
# Check for new bun.lockb files
13-
NEW_BUN=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E 'bun\.lockb$' || true)
14-
15-
# Check for npm scripts calling npm/bun in new or modified files
16-
NPM_CALLS=$(git diff HEAD~1 2>/dev/null | grep -E '^\+.*(npm|bun)\s+(run|install|start|test|build)' | grep -v '#' || true)
17-
18-
ERRORS=""
19-
20-
if [ -n "$NEW_BUN" ]; then
21-
ERRORS="${ERRORS}New bun.lockb detected. Use Deno instead.
22-
${NEW_BUN}
23-
"
24-
fi
25-
26-
if [ -n "$NPM_CALLS" ]; then
27-
ERRORS="${ERRORS}npm/bun commands in new code. Use Deno tasks instead.
28-
${NPM_CALLS}
29-
"
30-
fi
31-
32-
if [ -n "$ERRORS" ]; then
33-
echo -e "$ERRORS"
34-
echo ""
35-
echo "Per language policy, use Deno instead of npm/bun for:"
36-
echo " - Package management: deno.json imports"
37-
echo " - Task running: deno task <name>"
38-
echo " - Scripts: deno run script.ts"
31+
# Bun is tier 1 (owner ruling 2026-08-26): package.json + bun.lock are
32+
# EXPECTED. Only npm/pnpm/yarn lockfiles are rejected. .npmrc is
33+
# allowed - Bun reads it for private-registry auth.
34+
if [ -f "package-lock.json" ] || [ -f "pnpm-lock.yaml" ] || [ -f "yarn.lock" ]; then
35+
echo "❌ npm/pnpm/yarn artifacts detected. Use Bun (package.json + bun.lock) instead."
3936
exit 1
4037
fi
41-
42-
echo "Deno policy enforced (no new npm/bun usage)"
43-
44-
- name: Verify deno.json exists
45-
run: |
46-
if [ ! -f "deno.json" ]; then
47-
echo "Warning: deno.json not found"
48-
echo "Consider adding deno.json for Deno configuration"
49-
else
50-
echo "deno.json found"
51-
fi
38+
echo "✅ No npm/pnpm/yarn violations"

0 commit comments

Comments
 (0)