Skip to content

feat: initial GitHub Action for harmont pipelines#1

Merged
markovejnovic merged 13 commits into
mainfrom
initial-setup
May 25, 2026
Merged

feat: initial GitHub Action for harmont pipelines#1
markovejnovic merged 13 commits into
mainfrom
initial-setup

Conversation

@markovejnovic
Copy link
Copy Markdown
Contributor

@markovejnovic markovejnovic commented May 25, 2026

No description provided.

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.
@markovejnovic markovejnovic marked this pull request as ready for review May 25, 2026 22:08
@markovejnovic markovejnovic merged commit 0f49f4e into main May 25, 2026
4 of 7 checks passed
@markovejnovic markovejnovic deleted the initial-setup branch May 25, 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