refactor(ci): harden reusable build/publish workflow and standardize action output#101
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAcross 16 composite GitHub Actions, "Announce" initialization steps are replaced with "Initialize" steps that only write pending checkpoint statuses to ChangesLogging standardization across composite actions
New reusable build-and-publish-artifacts workflow
Sequence Diagram(s)sequenceDiagram
participant caller as Caller workflow
participant version as version job
participant nuget as nuget job (conditional)
participant ci as ci job
participant tag as tag job
caller->>version: workflow_call (major, minor, chart-name, ...)
version->>version: determine-semver → computed version
version-->>caller: outputs.version
alt nuget-projects non-empty
nuget->>nuget: dotnet-build (restore/build/test)
nuget->>nuget: dotnet-pack-push → NuGet source
end
ci->>ci: validate chart-name == Chart.yaml name
ci->>ci: docker-build-push → GHCR image + digest
ci->>ci: update chart version/appVersion, values.yaml
ci->>ci: helm lint + package → .tgz
ci->>ci: helm push OCI → GHCR
ci-->>caller: outputs.docker-image, outputs.helm-chart
tag->>tag: tag-github-origin (version tag)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Hardens the reusable
build-and-publish-artifactspipeline against current GitHubActions best practices and standardizes log/annotation output across the repo's
composite actions. Three themes: security/least-privilege, reliability, and
developer experience (cleaner logs). No change to the public input/secret/output
contract of the reusable workflow.
Reusable workflow (
reusable-build-and-publish-artifacts.yml)Security & least privilege
permissionsdropped tocontents: read; each job now escalates onlywhat it needs (
version→read,nuget/ci→read +packages: write,tag→contents: write). Removes the blanketcontents: writepreviously grantedto every job.
${{ … }}values are passed viaenv:andreferenced as
$VARinsiderun:blocks (no direct interpolation into shell).persist-credentials: falseon theci/nugetcheckouts (neither pushes via git).pull_request_targetsafety warning for callers.Reliability
concurrency(per-ref,cancel-in-progress: false) so concurrent runs can'trace the tag-based semver and collide when tagging — without interrupting an
in-flight registry push.
tagjob that runs only afterversion+ci(and
nuget, when present) succeed, so tags never point at an unpublished build.timeout-minuteson every job.sedto structuralyq(preserves sibling/unrelated keys; creates
appVersionif absent), plus ahelm lintgate before packaging.Performance
dotnet-buildcomposite (~/.nuget/packages, keyed onproject/package manifests). Docker layer caching (
type=gha) was already in place.Output cleanup (reusable workflow + 16 composite actions)
Aligns all actions with GitHub guidance that annotations are for sparse, actionable
signals while job summaries / collapsible groups carry rich output:
::notice::(annotation-panelspam). The pipeline now emits one run-level
::notice::— a pointer to thepublished artifact.
✅lines inside::group::s; console key/valueoutput aligned.
echo "Warning:"to real::warning::annotations.::error::failure annotations retained unchanged.Behavior change to note for reviewers
The git tag is now created after a successful build (was up-front). A green run
tags at the very end; anything keyed on the tag appearing early will see it last.
This is the intended fix for orphaned tags from failed builds.
Verification
actionlinton the workflow: clean (validates expressions incl. thetagjob'sif:, and shellchecksrun:steps).bash -nacross all 96run:blocks (workflow + composites): 0 syntax errors.yqmetadata logic executed against real Chart.yaml/values.yaml fixtures(mikefarah v4): version/appVersion/image.repository/image.tag set correctly,
sibling and unrelated keys preserved.
::group::/::endgroup::balance, and annotation inventory verifiedacross all 17 files; diffs are output-only; no trailing whitespace introduced.
Not covered: a live end-to-end run (requires hosted runner, real secrets, and
GHCR/registry auth) — concurrency/tag-timing and registry push are unproven locally.
Summary by CodeRabbit
New Features
Chores