Skip to content

Switch release trigger from tag push to GitHub Release published event#2

Merged
alongubkin merged 16 commits into
mainfrom
alon/alien-9-dockdash-switch-release-trigger-from-tag-push-to-github
Mar 12, 2026
Merged

Switch release trigger from tag push to GitHub Release published event#2
alongubkin merged 16 commits into
mainfrom
alon/alien-9-dockdash-switch-release-trigger-from-tag-push-to-github

Conversation

@alongubkin
Copy link
Copy Markdown
Member

Summary

  • Replace push: tags: v* with release: types: [published] so the pipeline only fires after explicitly publishing a draft release
  • Remove the github-release job — the release already exists when the workflow runs, making it redundant

Test plan

  • Create a draft release on GitHub with a v* tag
  • Verify the workflow does NOT trigger on draft creation
  • Publish the release and verify the workflow triggers and publishes to crates.io successfully

@greptile please review

🤖 Generated with Claude Code

alongubkin and others added 13 commits March 8, 2026 23:42
Rust library for building and pushing OCI container images without Docker.
Includes layer builder, image builder, blob caching, registry push with
auth support, CI/CD workflows, and crates.io release pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The integration tests in build_push_tests.rs need the test-utils feature
and a Docker daemon. Run only --lib tests in CI to avoid compilation errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The extract method was unconditionally applying zstd decompression to all
layers, but base image layers from registries are typically gzip-compressed.
Now checks the layer media type and uses the appropriate decompressor.

Also removes redundant gcr.io hostname checks in monolithic push detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Preserve base image CMD when only entrypoint is overridden (CMD is
  only cleared when entrypoint is explicitly set, matching Docker behavior)
- Remove dead branch in push code (layers_to_push.is_empty() was
  unreachable after the early return above)
- Handle uncompressed tar layers in extract (media types without +gzip
  or +zstd are now extracted as plain tar)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Distinguish gzip vs uncompressed Docker layers by checking for "gzip"
  in media type instead of matching all rootfs media types as gzip
- Reset CMD to None (not empty array) when entrypoint overrides it,
  matching OCI spec semantics
- Warn when only one of platform_os/platform_arch is set in
  PullAndExtractOptions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…g print

- Record per-file metadata when adding directories to layers so the
  input-based cache key reflects actual directory contents (prevents
  stale cache hits when files inside a directory change)
- Scope DOCKER_USERNAME/DOCKER_PASSWORD env vars to Docker Hub only,
  preventing credential leakage to unrelated registries
- Remove leftover eprintln! debug statement in layer cache miss path
- Document self-mount blob existence check workaround (oci-client
  lacks a HEAD blob API)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… dedup

- Handle OCI/Docker whiteout files (.wh.<name> and .wh..wh..opq)
  during layer extraction so deleted files from prior layers are
  properly removed from the merged filesystem
- Fix duplicate error message in From<io::Error> impl that produced
  "I/O error: Permission denied: Permission denied"
- Deduplicate IMAGE_LAYER_ZSTD_MEDIA_TYPE constant into lib.rs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…content

- Include OS and arch in manifest cache key (manifest-v2:{ref}:{os}:{arch})
  so multi-platform builds don't serve wrong cached manifests
- Hash in-memory content in data() FileMetadata so same-size blobs
  at the same path produce different input cache keys

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…io::Error>

The Docker Hub-only scoping of DOCKER_USERNAME/DOCKER_PASSWORD was a
usability regression — CI/CD users commonly set these for any registry.
The From<io::Error> impl was unused since all call sites construct
Error::Io with contextual messages; removing it enforces that pattern.
Also applies rustfmt formatting fixes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace push: tags: v* with release: types: [published] so releases
require an explicit publish action, allowing draft review before the
pipeline fires. Remove the github-release job since the release already
exists when the workflow runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented Mar 12, 2026

ALIEN-9 Dockdash: Switch release trigger from tag push to GitHub Release published event

Currently the release workflow triggers on any v* tag push, which immediately publishes to crates.io with no opportunity to review. Switch to release: types: [published] so the flow is: create draft release → review/edit notes → publish → pipeline fires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alongubkin
Copy link
Copy Markdown
Member Author

@greptile please review

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 12, 2026

Greptile Summary

This PR simplifies the release workflow by switching the trigger from a raw tag push (push: tags: v*) to a GitHub Release published event (release: types: [published]), and removes the now-redundant github-release job that previously created the GitHub Release as a downstream step.

  • The new trigger ensures the workflow only fires when a release is explicitly published, preventing accidental CI runs on bare tag pushes.
  • Removing the softprops/action-gh-release job is correct — when the workflow is triggered by release: types: [published], the release already exists in GitHub, making re-creation redundant.
  • The permissions: contents: write permission is now stale. The only remaining job (publish) calls cargo publish via a crates.io token and does not write anything back to GitHub. This should be downgraded to contents: read or removed entirely to follow the principle of least privilege.

Confidence Score: 4/5

  • PR is safe to merge; the logic change is correct with one minor leftover permission to clean up.
  • The trigger change and job removal are both logically sound and well-motivated. The only issue is a stale contents: write permission that is no longer needed after the github-release job was removed — this is a best-practice concern rather than a functional bug.
  • .github/workflows/release.yml — verify the contents: write permission is intentionally kept or remove it.

Important Files Changed

Filename Overview
.github/workflows/release.yml Trigger switched from push: tags: v* to release: types: [published] and the now-redundant github-release job removed; minor issue: contents: write permission is no longer needed.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub
    participant WF as Release Workflow
    participant Crates as crates.io

    Note over Dev,GH: Old flow (before PR)
    Dev->>GH: git push tag v*
    GH->>WF: Trigger (push: tags v*)
    WF->>Crates: cargo publish
    WF->>GH: Create GitHub Release (softprops/action-gh-release)

    Note over Dev,GH: New flow (after PR)
    Dev->>GH: Create draft release
    Dev->>GH: Publish release
    GH->>WF: Trigger (release: types published)
    WF->>Crates: cargo publish
Loading

Last reviewed commit: 162ba76

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
The github-release job that wrote back to GitHub was removed, so
contents: write is no longer needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alongubkin
Copy link
Copy Markdown
Member Author

Fixed — downgraded contents: write to contents: read in d7a94b2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alongubkin alongubkin merged commit daff494 into main Mar 12, 2026
6 checks passed
@alongubkin alongubkin deleted the alon/alien-9-dockdash-switch-release-trigger-from-tag-push-to-github branch March 12, 2026 21:51
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