Skip to content

refactor(ci): migrate to centralized tankdonut/github-actions@v1 - #56

Merged
tankdonut merged 2 commits into
mainfrom
ci/centralized-actions
Jul 21, 2026
Merged

refactor(ci): migrate to centralized tankdonut/github-actions@v1#56
tankdonut merged 2 commits into
mainfrom
ci/centralized-actions

Conversation

@tankdonut

Copy link
Copy Markdown
Owner

Summary

Replaces the monolithic .github/workflows/ci.yml (3-job pipeline) with four focused workflows that consume reusable actions from tankdonut/github-actions@v1, mirroring the pattern already in production for tankdonut/toolbx-containers.

Workflows

File Action consumed Trigger
lint-and-test.yaml pre-commit@v1 every PR + push to main
build-and-publish-image.yaml ghcr-login@v1 (runtime: docker) PR (paths), push to main (paths), weekly schedule, workflow_dispatch
prune-ghcr-images.yaml reusable prune-ghcr.yaml@v1 daily cron + workflow_dispatch
renovate-auto-approve.yaml renovate-auto-approve@v1 Renovate PR open/ready/synchronize

build-and-publish-image.yaml preserves every opencode-specific step: validate.sh → build.sh → tag (sha, version, latest) → container-test.sh → trivy (advisory) → ghcr-login → triple-push. Publish is gated if: github.event_name != 'pull_request' so PR runs validate everything without publishing.

renovate.json

Now matches the centralized config: platformAutomerge: true, automergeStrategy: squash, three packageRules (non-major automerge, devDeps automerge, major manual). minimumReleaseAge: "7 days" preserved — matches the AGENTS.md supply-chain guardrails (npmrc min-release-age=7, uv exclude-newer=7d).

Removed

  • ci.yml deleted entirely.
  • ci-status aggregator job dropped (no cross-workflow needs).
  • setup-node step dropped (validate.sh is pure bash; no node dependency).
  • master branch trigger + tests/** path filter dropped (vestigial).

Doc updates

README badge swapped to build-and-publish-image.yaml; every ci.yml reference updated across AGENTS.md, DEVELOPMENT.md, scripts/AGENTS.md, tests/AGENTS.md (file tree, CI Integration section, File Inventory table, code-comment pointers).

Verification

  • python3 yaml.safe_load parses all 4 workflows
  • jq . renovate.json validates (minimumReleaseAge=7 days, platformAutomerge=true, automergeStrategy=squash, 3 packageRules)
  • All 4 centralized action refs use tankdonut/github-actions@v1
  • pre-commit run --files clean (trailing whitespace, EOF, mixed-line-ending, large files, merge conflicts, private key)
  • actionlint reports only one info-level SC2086 on \$GITHUB_ENV (unquoted) — matches upstream toolbx + original ci.yml convention; runner-provided absolute path, no functional issue

⚠️ Manual post-merge steps (out-of-repo)

These cannot be done in-repo and are required for full functionality:

  1. Create AUTO_APPROVE_PAT repo secret — classic PAT with repo scope, or fine-grained token with PR-approve permission. Without it, renovate-auto-approve.yaml fails on every Renovate PR.
  2. Update branch-protection required checks on main: the old CI / CI Status aggregator no longer exists. Require Lint & Test / pre-commit + Build & Publish Image / release.
  3. Enable "Allow GitHub Actions to approve pull requests" in repo settings → General → Pull Requests. Required for platformAutomerge to function.

Test plan

  • CI runs green on this PR (Lint & Test + Build & Publish Image)
  • After merge: gh workflow list shows the 4 new workflows
  • After merge: gh workflow run prune-ghcr-images.yaml dispatches without error
  • After merge: a throwaway PR confirms the pipeline still gates merges correctly

Replace the monolithic .github/workflows/ci.yml (3-job pipeline) with four
focused workflows that consume reusable actions from tankdonut/github-actions@v1,
mirroring the pattern already in use for tankdonut/toolbx-containers.

Workflows:
- lint-and-test.yaml       — pre-commit@v1 on every PR + push to main
- build-and-publish-image.yaml — validate.sh -> build.sh -> container-test.sh
                                  -> trivy -> ghcr-login@v1 (runtime: docker)
                                  -> triple-push to ghcr.io (non-PR only)
                                  Weekly schedule + disk-space freeing step
- prune-ghcr-images.yaml   — reusable prune-ghcr.yaml@v1, daily cron,
                             packages: ["opencoder"]
- renovate-auto-approve.yaml — renovate-auto-approve@v1 on Renovate PRs,
                               concurrency-grouped

renovate.json now matches the centralized config (platformAutomerge,
automergeStrategy: squash, three packageRules); minimumReleaseAge=7 days
preserved to match the AGENTS.md supply-chain guardrails.

ci-status aggregator job dropped (no cross-workflow needs); branch
protection must move to Lint & Test + Build & Publish Image required
checks.

Manual post-merge steps (out-of-repo):
- Create AUTO_APPROVE_PAT repo secret (PAT with PR-approve scope)
- Update branch-protection required checks
- Enable 'Allow GitHub Actions to approve pull requests' for platformAutomerge

Verification: yaml.safe_load on all 4 workflows; jq on renovate.json;
pre-commit run --files clean; actionlint reports only the upstream-matching
SC2086 info on $GITHUB_ENV.
@tankdonut tankdonut self-assigned this Jul 21, 2026
The centralized tankdonut/github-actions/actions/pre-commit@v1 action
internally calls install-asdf-dependencies@v1, which reads .tool-versions
and installs declared tools via asdf. Without this file, hadolint is never
installed and the pre-commit hadolint hook fails with
'Executable hadolint not found'.

toolbx-containers ships the same .tool-versions pattern; this matches it.

Version 2.14.0 aligns with the hadolint hook pin in .pre-commit-config.yaml.
@tankdonut
tankdonut merged commit 0ee9085 into main Jul 21, 2026
3 checks passed
@tankdonut
tankdonut deleted the ci/centralized-actions branch July 21, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant