chore(ci): harden supply-chain controls before reopening PRs

Isolate npm publish from PR CI, enforce frozen lockfiles and a 24h
minimumReleaseAge, and document safe pull_request_target usage so fork
PRs cannot reach publish credentials.

Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-08-10 21:00:29 +01:00
committed by Rotimi Best
co-authored by Rotimi Best
parent bbf5eb24de
commit 9adc38bd8a
13 changed files with 100 additions and 24 deletions
+6 -13
View File
@@ -1,22 +1,16 @@
name: Publish @classroomio/mcp to NPM
# Publish-only. Never triggered by pull_request — keeps NPM_TOKEN off the PR trust boundary.
# PR/push build verification lives in mcp-package-build-check.yml.
on:
workflow_dispatch:
pull_request:
paths:
- "packages/mcp/**"
push:
paths:
- "packages/mcp/**"
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
environment: production
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
@@ -24,18 +18,17 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.19.3
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Build publishable MCP package
run: pnpm mcp:build
- name: Publish package
if: github.event_name == 'workflow_dispatch'
run: pnpm --filter @classroomio/mcp publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}