Skip to content

Scan generated Docs content before sync pushes - #35

Merged
xgame92 merged 1 commit into
mainfrom
codex/scan-docs-sync-staged
Dec 4, 2026
Merged

xgame92 merged 1 commit into
mainfrom
codex/scan-docs-sync-staged

Conversation

@xgame92

@xgame92 xgame92 commented Dec 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Scan the exact staged content before changed documentation syncs build or push.
  • Share the existing pinned and checksum-verified Gitleaks installer between Sync and the repository history scan. The no-change path skips installation.

Verification

The shared installer verified the published Linux archive checksum and installed Gitleaks 8.30.1 in a local Linux container. The staged scan then passed for the exact generated diff from the most recent changed sync. Shell syntax and the exact PR commit scan also passed.

The sync pushes with the workflow token. GitHub documents that this push does not invoke ordinary push-triggered jobs.

https://docs.github.com/en/actions/concepts/security/github_token#when-github_token-triggers-workflow-runs

@devin-ai-integration

Copy link
Copy Markdown
Contributor

APPROVE — independent review of exact 79746f2cc15a04ffd3c1431c16f7375c40040834 against f6cdb5c7544d3c9fc57afabefed86fc3cff6ab26. (Review performed by Devin, Cognition AI's model family.)

All four review axes verified:

  • Fails closed before the push: the step order in the Sync job is stage → scan → pnpm verify → commit+push. The scan runs with --exit-code 1, so any finding stops the job before the commit and push steps exist; the conditional chain means a failed scan can never be skipped into a push. The comment correctly states why this scan is needed inline — a push made with the workflow token does not trigger the push-scoped Secret scan workflow.
  • Same pinned/checksummed Linux Gitleaks: the installer is byte-equivalent to the inline version it replaces — same version 8.30.1, same sha256 — now shared verbatim by both workflows. I independently re-downloaded the release archive and confirmed its sha256 matches the pinned value exactly. The installer also runs on Linux as written: it produces the binary at exactly the $RUNNER_TEMP/gitleaks/gitleaks path both workflows invoke.
  • Scans exactly the staged generated changes: git add --all stages only the generated paths, gitleaks git --staged scans precisely that index delta, and the commit step commits the same staged set — nothing unscanned can be committed, and nothing outside the generated paths is swept in. Smoke-verified with the pinned 8.30.1 binary: the exact command line (git --staged --redact --no-banner --config .gitleaks.toml --exit-code 1) exits 0 on a benign staged delta and on an empty index; no secret-shaped inputs were used.
  • Skips when there are no changes: the scan step, the verify step and the commit step are all gated on changed == 'true', and an empty diff short-circuits at the Anything new? step.

Non-blocking observations:

  • The installer's mkdir is intentionally not -p; a second install in the same job would fail rather than silently reuse. Fine as each job installs once on a fresh runner, and arguably the stricter behavior is the right default.
  • The scan runs before pnpm verify, so secrets are screened even before the build gate — the safer ordering for feedback.

Exact head unchanged during review. Read-only review; no edits, merges or sync replays.

@xgame92
xgame92 merged commit 2c24bf4 into main Dec 4, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant