feat: deploy-artifact, leak-scan and deploy-validate reusable workflows#31
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 pinneddeploy-config-schemaand 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 agate-summary.json(SC-4) on every exit path. The image lock crosses the boundary only as a workflow artifact (image-lock-artifactis the sole lock input). The render composite action declaresrender-hashin itsaction.ymloutputs. 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 canonicaldata/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.share pinned by version + SHA256 (digests computed from the actual release artifacts). A renovatepinDigestsgroup keeps the pins current. Existing workflows keep their tag pins; new-workflow SHA pinning is the forward convention.Tests:
python -m unittest discover -s testsin the CI venv — 86 pass, coverage 91%.