Skip to content

Commit e2a49aa

Browse files
committed
Update documentation to require full commit SHAs
GitHub Actions are configured to require full-length commit SHAs, not branch names like @main. Updated all CI workflow references to use @<SHA> format with critical warnings throughout documentation
1 parent f78cd27 commit e2a49aa

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,26 +419,30 @@ Follow the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format:
419419
- **Standard SHAs**: `actions/checkout@08c6903...5dd907a8` (v5.0.0), `pnpm/action-setup@a7487c7...0d66ddda` (v4.1.0), `actions/setup-node@a0853c24...8a591444` (v5.0.0), `actions/upload-artifact@50769540...35e0d6874` (v4.4.0)
420420

421421
### CI Workflow Strategy
422-
- **🚨 MANDATORY**: Use `SocketDev/socket-registry/.github/workflows/ci.yml@main`
422+
- **🚨 MANDATORY**: Use `SocketDev/socket-registry/.github/workflows/ci.yml@<SHA>` with full commit SHA
423+
- **🚨 CRITICAL**: GitHub Actions are configured to require full-length commit SHAs, NOT branch names like `@main`
423424
- **Benefits**: Consistent CI, parallel execution of lint/type-check/test/coverage
424425
- **Configuration**: Customize via inputs (lint-script, test-script, type-check-script, node-versions, os-versions, etc.)
426+
- **Format**: `uses: SocketDev/socket-registry/.github/workflows/ci.yml@662bbcab1b7533e24ba8e3446cffd8a7e5f7617e # main`
425427

426428
#### CI Script Naming Convention (MANDATORY)
427429
- **lint-ci**: `"pnpm run check:lint"` - Linting without fixing
428430
- **test-ci**: `"dotenvx -q run -f .env.test -- vitest run"` - Tests without watch mode (no linting/building)
429431
- **type-ci**: `"pnpm run check:tsc"` - Type checking without emitting files
430432

431433
### Git SHA Management (CRITICAL)
434+
- **🚨 SECURITY REQUIREMENT**: GitHub Actions require full-length commit SHAs to be pinned
432435
- **🚨 NEVER GUESS OR MAKE UP GIT SHAs**: Always retrieve the exact full SHA using `git rev-parse`
433436
-CORRECT: `cd /path/to/repo && git rev-parse HEAD` or `git rev-parse main`
434-
-WRONG: Guessing the rest of a SHA after seeing only the short version (e.g., `43a668e1`)
435-
- **Why this matters**: GitHub Actions workflow references require exact, full 40-character SHAs
436-
- **Consequences of wrong SHA**: Workflow failures with "workflow was not found" errors
437+
-FORBIDDEN: Using `@main` or `@master` in workflow references
438+
-FORBIDDEN: Guessing the rest of a SHA after seeing only the short version (e.g., `43a668e1`)
439+
- **Why this matters**: GitHub Actions are configured with "Require actions to be pinned to a full-length commit SHA"
440+
- **Consequences of wrong SHA**: CI fails with "workflow was not found" or security policy violations
437441
- **Updating workflow SHA references**: When updating SHA references in workflow files:
438-
1. Get the exact full SHA: `cd repo && git rev-parse HEAD`
439-
2. Use the FULL 40-character SHA in sed commands
442+
1. Get the exact full SHA: `cd /path/to/socket-registry && git rev-parse main`
443+
2. Use the FULL 40-character SHA in workflow files: `@662bbcab1b7533e24ba8e3446cffd8a7e5f7617e # main`
440444
3. Verify the SHA exists: `git show <sha> --stat`
441-
- **Rationale**: Using incorrect SHAs breaks CI/CD pipelines and wastes debugging time
445+
- **Rationale**: Security policy requires pinned SHAs for reproducible, auditable builds
442446

443447
## Architecture
444448

docs/CI_TESTING_TOOLS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ Quick reference for the CI testing and validation tools.
77
**These tools are specific to socket-registry's package override structure.** Other Socket projects (socket-sdk-js, socket-cli, socket-packageurl-js) should reference socket-registry's reusable CI workflows but do not need these validation scripts.
88

99
**For general CI workflow usage**, see:
10-
- Socket-registry's reusable CI workflow: `SocketDev/socket-registry/.github/workflows/ci.yml@main`
10+
- Socket-registry's reusable CI workflow: `SocketDev/socket-registry/.github/workflows/ci.yml@<SHA>` (must use full commit SHA, not @main)
1111
- Other projects' CI documentation: `docs/CI_TESTING.md` in each repository
1212

13+
**🚨 CRITICAL**: GitHub Actions are configured to require full-length commit SHAs. Never use `@main` - always use `@662bbcab1b7533e24ba8e3446cffd8a7e5f7617e # main` format.
14+
1315
## TL;DR
1416

1517
```bash

docs/PACKAGE_TESTING_GUIDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ This guide provides a comprehensive approach to prevent recurring CI failures in
77
**This guide is specific to socket-registry's package override structure.** Other Socket projects (socket-sdk-js, socket-cli, socket-packageurl-js) have different testing needs and should refer to their own CI documentation.
88

99
**For general CI workflow usage across Socket projects**, see:
10-
- Socket-registry's reusable CI workflow: `SocketDev/socket-registry/.github/workflows/ci.yml@main`
10+
- Socket-registry's reusable CI workflow: `SocketDev/socket-registry/.github/workflows/ci.yml@<SHA>` (must use full commit SHA, not @main)
1111
- Other projects' CI documentation: `docs/CI_TESTING.md` in each repository
1212

13+
**🚨 CRITICAL**: GitHub Actions are configured to require full-length commit SHAs. Never use `@main` - always use `@662bbcab1b7533e24ba8e3446cffd8a7e5f7617e # main` format.
14+
1315
## Quick Start
1416

1517
Before releasing any package override (socket-registry only):

0 commit comments

Comments
 (0)