feat(workflows): add reusable go-ci + release-image at .github/workflows#3
Merged
Conversation
Migrates go-ci + release-image from `workflow-templates/` (GitHub UI new-repo template feature) to `.github/workflows/` so consumers can `uses:` them. Original templates retained for the new-repo bootstrap feature. Reusable upgrades over the template versions: - go-ci: golangci-lint v2 (was v1.59); per-package coverage via consumer-owned cover-script input (was project-wide single threshold); split jobs for unit / cover-check / integration / e2e (build-tag matrix); sqlc-verify + helm-lint; gated by enable-* inputs. - release-image: tag triple per build-release §4.1 (added sha-<sha>); buildx + metadata-action; --build-arg TARGET=<binary> wired alongside --target so multi-binary Dockerfile (server + migrator) works from one workflow. Spec: agent-manager/docs/standards/build-release.md §2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile Summary
Confidence Score: 5/5Safe to merge; all previously flagged P1 issues are resolved and only a P2 style suggestion remains The three P1/P0 findings from the prior review round (ungated cover-check, broken latest tag, unquoted coverage-script injection) are all fixed. The only remaining finding is a P2 — two .github/workflows/go-ci.yml lines 147 and 162 — minor injection-pattern cleanup to match the already-fixed Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Consumer Repo
participant GCI as go-ci.yml (reusable)
participant RCI as release-image.yml (reusable)
participant GHCR as ghcr.io
Note over C,GCI: On push / PR
C->>GCI: "workflow_call (service-name, enable-*, secrets: inherit)"
par Parallel jobs
GCI->>GCI: lint (golangci-lint v2)
GCI->>GCI: unit (go test -race)
GCI->>GCI: cover-check (if enable-cover-check)
GCI->>GCI: "integration (if enable-integration, -tags=integration)"
GCI->>GCI: "e2e (if enable-e2e, -tags=e2e)"
GCI->>GCI: sqlc-verify (if enable-sqlc-verify)
GCI->>GCI: helm-lint (if enable-helm-lint)
GCI->>GCI: commitlint (if enable-commitlint)
end
Note over C,GHCR: On tag push (matrix: binary)
C->>RCI: workflow_call (service, binary, secrets: inherit)
RCI->>GHCR: docker login (GHCR_TOKEN)
RCI->>RCI: metadata-action → tags (git_tag, sha-short, latest)
RCI->>GHCR: "build-push (--target binary, --build-arg TARGET=binary)"
alt COSIGN_KEY provided
RCI->>RCI: cosign sign image digest
RCI->>RCI: anchore/sbom-action → spdx-json
end
Reviews (2): Last reviewed commit: "fix(workflows): gate cover-check, fix la..." | Re-trigger Greptile |
… shell input
Greptile P1 (round 1):
- cover-check job had no enable-* toggle while every other optional job did
(enable-integration / enable-e2e / etc.). Added `enable-cover-check` input
(default true) + `if: inputs.enable-cover-check`. Consumers without
scripts/cover-check.sh can now opt out.
- release-image `latest` tag was gated on `is_default_branch`, which evaluates
to `false` on tag pushes (github.ref = refs/tags/v0.2.0, not refs/heads/main).
Tag triple §4.1 silently lost the third tag. Switched to
`enable=${{ github.ref_type == 'tag' }}` so latest is set on every tag push.
Greptile P2:
- coverage-script input was inlined into `bash ${{ inputs.coverage-script }}`
without quoting — workflow-template injection vulnerability. Bot suggested
shell-quoting; chose env-var indirection instead (canonical safe pattern):
`env: COVERAGE_SCRIPT: ${{ inputs.coverage-script }}; run: bash "$COVERAGE_SCRIPT"`.
Quoting alone breaks if input contains a `"`; env var fully sandboxes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
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.
Summary
go-ciandrelease-imagefromworkflow-templates/(GitHub UI new-repo template feature) to.github/workflows/so consumers can call them viauses:.workflow-templates/*.yamlretained for the new-repo bootstrap feature; a future PR can decide their fate post-Task-32.Reusable upgrades over template versions
go-ci.yml
.golangci.ymlv2 schema).coverage-scriptinput (default./scripts/cover-check.sh). Replaces the project-wide single-threshold gate that contradicts the per-package ramp.lint,unit,cover-check,integration(-tags=integration),e2e(-tags=e2e),sqlc-verify,helm-lint,commitlint. Each gateable viaenable-*inputs.git config insteadOftrick.release-image.yml
agent-manager/docs/standards/build-release.md§4.1:<git_tag>,sha-<short_sha>,latest(was missingsha-<sha>).docker/metadata-actionfor canonical tag computation.--build-arg TARGET=<binary>wired alongside--targetso a multi-binary Dockerfile (server + migrator) works from one reusable workflow; consumer matrices overbinary: [server, migrator].service+binaryinstead of singleimage-name— image isghcr.io/paper-board/${service}-${binary}:<tag>.Test plan
.golangci.ymlv2 schema without error../scripts/cover-check.shand passes 70% oninternal/core.v0.2.0,sha-<sha>,latest.🤖 Generated with Claude Code