Skip to content

Commit b94a108

Browse files
committed
docs: add Git SHA management guidelines to CLAUDE.md
1 parent 07bacb8 commit b94a108

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,18 @@ Follow the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format:
428428
- **test-ci**: `"dotenvx -q run -f .env.test -- vitest run"` - Tests without watch mode (no linting/building)
429429
- **type-ci**: `"pnpm run check:tsc"` - Type checking without emitting files
430430

431+
### Git SHA Management (CRITICAL)
432+
- **🚨 NEVER GUESS OR MAKE UP GIT SHAs**: Always retrieve the exact full SHA using `git rev-parse`
433+
-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+
- **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
440+
3. Verify the SHA exists: `git show <sha> --stat`
441+
- **Rationale**: Using incorrect SHAs breaks CI/CD pipelines and wastes debugging time
442+
431443
## Architecture
432444

433445
This is a monorepo for Socket.dev optimized package overrides, built with JavaScript and managed with pnpm workspaces.

0 commit comments

Comments
 (0)