Skip to content

feat: deploy-artifact, leak-scan and deploy-validate reusable workflows#31

Merged
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
feat/deploy-platform-d
Jul 8, 2026
Merged

feat: deploy-artifact, leak-scan and deploy-validate reusable workflows#31
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
feat/deploy-platform-d

Conversation

@jorisjonkers-dev-agents

Copy link
Copy Markdown
Contributor

The deploy platform needs three reusable workflows that service repos and homelab-deploy call; none existed. This adds:

  • deploy-artifact.yml — renders a service's deploy artifact against the pinned deploy-config-schema and the digest-pinned public cluster context, runs kubeconform/secret-reject/leak-scan gates, publishes idempotently to GHCR via oras (tag-exists-with-different-content fails; identical content is a no-op), signs with keyless cosign, and emits a gate-summary.json (SC-4) on every exit path. The image lock crosses the boundary only as a workflow artifact (image-lock-artifact is the sole lock input). The render composite action declares render-hash in its action.yml outputs. npm signature verification failures are folded into the deploy-artifact gate summary before failing.
  • leak-scan.yml — gitleaks/trufflehog with mode matrix (all-refs, pr-diff, path scan) driven by the canonical data/leak-patterns.json ({modes, extra_paths} shape), which is also the file homelab-inventory's leak boundary loads.
  • deploy-validate.yml — PR-time dry-run that renders the deploy preview and posts/updates the Deploy Preview comment (workload counts, routes, gatus entries, image refs, readiness scorecard).

Third-party actions are pinned by commit SHA and tool binaries in install-tooling.sh are pinned by version + SHA256 (digests computed from the actual release artifacts). A renovate pinDigests group keeps the pins current. Existing workflows keep their tag pins; new-workflow SHA pinning is the forward convention.

Tests: python -m unittest discover -s tests in the CI venv — 86 pass, coverage 91%.

Implements Chunk D of the deploy platform build-out:

- .github/workflows/deploy-artifact.yml: reusable workflow for OCI artifact
  publish with idempotent push, race detection, keyless cosign signing, and
  SC-4 gate-summary emission on every failure path (finalize job, if: always())
- .github/workflows/leak-scan.yml: reusable workflow wrapping the leak-scan
  composite action; exposes gate-summary-artifact output
- .github/workflows/deploy-validate.yml: reusable workflow for PR deploy
  preview with sticky comment and SC-4 gate-summary; pull-requests:write
- actions/deploy-artifact/{action.yml,run.sh,publish.sh,install-tooling.sh}:
  composite action for rendering 5 fragments, kubeconform/kustomize validation,
  reject kind:Secret, emit-contract; render-hash declared in outputs block
  (correction #8); npm-signatures gate emitted before exit 1 (correction #9)
- actions/leak-scan/{action.yml,run.sh}: SC-8 path deny-list plus gitleaks/
  trufflehog wrappers; three scan modes (all-refs, pr-diff, path); redacted
  gate-summary.json (never exposes raw match content)
- actions/deploy-preview/{action.yml,run.sh}: SC-11 readiness scorecard,
  deploy-preview-summary.md rendering, sticky PR comment (post/update),
  escape-hatch detection, SC-4 gate-summary
- data/leak-patterns.json: SC-8 canonical source in {modes, extra_paths}
  shape (correction #5); deployment-artifact extra_paths = deploy/raw-manifests/**
- docs/action-pinning.md: action pinning policy
- renovate.json: add pinDigests:true globally; github-actions pinned digests
  group (weekly Monday); JorisJonkers-dev/github-workflows exempt (semver)
- tests/test_deploy_platform_d.py: 51 tests covering T-D1..T-D6
- tests/test_crac_train_workflow.py: update renovate.json contract test to
  accommodate the new pinDigests/packageRules fields
- .github/workflows/ci.yml: add PyYAML to python-tests venv for test_deploy_platform_d

VERIFICATION fix applied: image-lock-artifact is the only lock input on the
workflow_call interface (no image-lock-path alternative).
install-tooling.sh shipped with placeholder digests that would fail
checksum verification on first CI run; digests now computed from the
actual v2.4.3/1.28.0/1.2.3/0.7.0/5.6.0/4.45.3 release artifacts.
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit 2cbc78f into main Jul 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant