fix(opensource-pipeline): commit packaging and sanitizer fixes before publishing

The forker makes the only commit before the sanitizer and packager run,
and Step 7 publishes with `gh repo create --source=. --push`, which sends
commits, not the working tree. Packager output (LICENSE, README, CLAUDE.md,
setup.sh) never reached the public repo, and a secret the sanitizer caught
and the agent fixed in the working tree was still pushed in that commit.

- Fold sanitizer fixes and packager output into the single commit with
  `git commit --amend`, keeping FORK_REPORT.md and SANITIZATION_REPORT.md
  out through .git/info/exclude.
- Re-run the sanitizer after packaging (Step 5b) and refuse to push with
  uncommitted changes or more than one commit.
- Sanitizer Step 6 now runs the Step 1 secret patterns and Step 3 home
  path patterns over `git log -p --all`, not only a 4-keyword grep.

Signed-off-by: Wen <jwcastillo@gmail.com>
(cherry picked from commit fe767e2099)
This commit is contained in:
Wen authored and haelyra committed 2026-10-20 18:01:43 -04:00
1 parent f933bad11b
commit 3906ba98f3
3 files changed
+50 -5

No files matched your search

+5
View File
@@ -150,8 +150,13 @@ git commit -m "Initial open-source release
Forked from private source. All secrets stripped, internal references
replaced with configurable placeholders. See .env.example for configuration."
printf '%s\n' FORK_REPORT.md SANITIZATION_REPORT.md >> .git/info/exclude
```
This commit is provisional. The pipeline amends it after sanitizer fixes and packaging, so the
published history stays one commit (see the opensource-pipeline skill, Step 3). The reports never
go into it: `.git/info/exclude` keeps them out of `git add -A`.
### Step 7: Generate Fork Report
Create `FORK_REPORT.md` in the staging directory:
+12 -2
View File
@@ -135,10 +135,20 @@ cd PROJECT_DIR
git log --oneline | wc -l
# If > 1, history was not cleaned — FAIL
# Search history for potential secrets
git log -p | grep -iE '(password|secret|api.?key|token)' | head -20
# Write the full history to a file outside the project, so Steps 1-3 never scan it
HISTORY="$(mktemp)"
git log -p --all --no-color > "$HISTORY"
echo "$HISTORY"
# Broad keyword pass (WARNING — manual review)
grep -iE '(password|secret|api.?key|token)' "$HISTORY" | head -20
```
Steps 1-3 read the working tree, but the push sends commits. A secret fixed in a file but still in
a commit is published. Run every Step 1 pattern (CRITICAL) and the Step 3 home-directory patterns
over `$HISTORY` with the same tool you used for Steps 1-3. Any match is a FAIL, even when the
current file is clean. Delete `$HISTORY` when done.
### Step 7: Unreadable Files (WARNING)
Steps 1-3 only match text, so a credential sitting in a spreadsheet, a PDF or an embedded database