Skip to content

Commit 2e8607e

Browse files
committed
Document centralized CI workflow strategy in CLAUDE.md
Add comprehensive documentation for the new mandatory CI workflow pattern. All Socket projects should now use the centralized reusable ci.yml workflow from socket-registry for consistent CI orchestration.
1 parent adf28ce commit 2e8607e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

CLAUDE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,54 @@ Follow the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format:
246246
- Make entries human-readable, not machine diffs
247247
- Focus on notable changes that impact users
248248

249+
## 🔧 Git & Workflow
250+
251+
### GitHub Actions Guidelines
252+
- **🚨 MANDATORY**: All GitHub Actions MUST reference commit SHAs, not version tags
253+
- **Security requirement**: SocketDev repositories require pinned commit hashes for supply chain security
254+
- **🚨 MANDATORY**: Reusable workflows MUST be created in `socket-registry/.github/workflows/`, NOT in individual project repositories
255+
- **Workflow location**: Individual projects should reference workflows from `SocketDev/socket-registry/.github/workflows/`
256+
- **Standard action SHAs** (keep these updated across all Socket projects):
257+
- `actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8` (v5.0.0)
258+
- `pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda` (v4.1.0)
259+
- `actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444` (v5.0.0)
260+
- `actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874` (v4.4.0)
261+
- **Format**: Always include version comment: `uses: owner/repo@sha # vX.Y.Z`
262+
- **Examples**:
263+
- ✅ CORRECT: `uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0`
264+
- ✅ CORRECT: `uses: SocketDev/socket-registry/.github/workflows/test.yml@main`
265+
- ❌ FORBIDDEN: `uses: actions/checkout@v4` or `uses: actions/checkout@v5`
266+
- ❌ FORBIDDEN: `uses: ./.github/workflows/_reusable-test.yml` (reusable workflows belong in socket-registry)
267+
- **Allowed actions**: Either SocketDev-owned or pinned by SHA from trusted sources
268+
- **Cross-project consistency**: Maintain identical SHAs across all Socket projects
269+
270+
### CI Workflow Strategy
271+
- **🚨 MANDATORY**: Use the centralized `ci.yml` reusable workflow from socket-registry
272+
- **Workflow location**: `SocketDev/socket-registry/.github/workflows/ci.yml@main`
273+
- **Benefits**: Consistent CI strategy across all Socket projects, parallel execution of lint/type-check/test/coverage
274+
- **Configuration**: Customize via workflow inputs (scripts, node versions, OS versions, timeouts, etc.)
275+
- **Standard configuration pattern**:
276+
```yaml
277+
jobs:
278+
ci:
279+
name: Run CI Pipeline
280+
uses: SocketDev/socket-registry/.github/workflows/ci.yml@main
281+
with:
282+
coverage-script: 'pnpm run test:unit:coverage'
283+
coverage-report-script: 'pnpm run coverage:percent --json'
284+
fail-fast: false
285+
lint-script: 'pnpm run check-ci'
286+
node-versions: '[20, 22, 24]'
287+
os-versions: '["ubuntu-latest", "windows-latest"]'
288+
test-script: 'pnpm run test-ci'
289+
test-setup-script: 'pnpm run build'
290+
type-check-script: 'pnpm run check:tsc'
291+
type-check-setup-script: 'pnpm run build'
292+
```
293+
- **Orchestration**: CI workflow orchestrates lint.yml, types.yml, test.yml, and coverage reporting
294+
- **Individual workflows**: Keep lint.yml, types.yml, test.yml for targeted runs; ci.yml runs all together
295+
- **Cross-project consistency**: All Socket projects should use identical CI orchestration pattern
296+
249297
## Architecture
250298
251299
This is a TypeScript implementation of the Package URL (purl) specification for parsing and constructing package URLs, compiled to CommonJS for deployment.

0 commit comments

Comments
 (0)