Skip to content

Commit 019e654

Browse files
committed
docs: add Git SHA management guidelines to CLAUDE.md
1 parent 4df924e commit 019e654

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,18 @@ Socket CLI integrates with:
230230
5. Stage and commit docs: `git commit --no-verify -m "message"`
231231
- **Rationale**: Reduces commit time while maintaining code quality through initial validation
232232

233+
### Git SHA Management (CRITICAL)
234+
- **🚨 NEVER GUESS OR MAKE UP GIT SHAs**: Always retrieve the exact full SHA using `git rev-parse`
235+
- ✅ CORRECT: `cd /path/to/repo && git rev-parse HEAD` or `git rev-parse main`
236+
- ❌ WRONG: Guessing the rest of a SHA after seeing only the short version (e.g., `43a668e1`)
237+
- **Why this matters**: GitHub Actions workflow references require exact, full 40-character SHAs
238+
- **Consequences of wrong SHA**: Workflow failures with "workflow was not found" errors
239+
- **Updating workflow SHA references**: When updating SHA references in workflow files:
240+
1. Get the exact full SHA: `cd repo && git rev-parse HEAD`
241+
2. Use the FULL 40-character SHA in sed commands
242+
3. Verify the SHA exists: `git show <sha> --stat`
243+
- **Rationale**: Using incorrect SHAs breaks CI/CD pipelines and wastes debugging time
244+
233245
## 🔍 DEBUGGING
234246

235247
### CI vs Local

0 commit comments

Comments
 (0)