feat: harmont GitHub Action with Docker image caching#2
Merged
Conversation
Resolves user-provided version input (latest, 1.2.3, v1.2.3) into a concrete release tag. Uses CURL_CMD env var for testability.
- Pass user inputs via env vars instead of inline ${{ }} interpolation
in run blocks (prevents script injection in action.yml and setup/action.yml)
- Check cache directory contents instead of cache-hit output for prefix
matches in cache-restore (prefix restores don't set cache-hit=true)
- Add GITHUB_TOKEN auth header to GitHub API calls in resolve-version.sh
(avoids 60 req/hr unauthenticated rate limit on shared runners)
- Add actions/cache step in setup/ keyed on version + OS + arch - Skip download entirely on cache hit (instant setup on repeat runs) - Remove install-python-dsl input — hm embeds its own DSL engine - Add setup-cached test job to verify cache behavior
New cache-backend input: 'gha' (default, existing behavior) or
'registry' (pushes/pulls images to a container registry).
Registry backend advantages over GHA cache:
- No 10GB size limit (GHCR storage is separate)
- Native Docker layer deduplication (shared base layers stored once)
- Per-image granularity (only changed images push/pull)
- Faster for large images (Docker pull vs untar from GHA cache)
Usage:
- uses: harmont-dev/actions-hm@v1
with:
pipeline: ci
cache-backend: registry
permissions:
packages: write
Images stored at ghcr.io/<owner>/<repo>/harmont-cache/<step>:<hash>
Breaking: removed GHA cache backend entirely. All Docker image caching now goes through a container registry (GHCR by default). Cache save now includes automatic cleanup: - After pushing current images, queries GitHub Packages API for stale versions of each step's image - Keeps N previous versions (configurable via cleanup-keep, default 2) - Deletes older versions to prevent unbounded registry growth - Requires packages:delete permission (gracefully skips if denied) Manifest stored as a scratch image (ghcr.io/.../manifest:latest) so restore can bootstrap without prior local state.
# Conflicts: # README.md # action.yml
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.
No description provided.