fix(ci): correct git-cliff archive path in tar extraction #39

Merged
sarman merged 1 commits from feat/git-cliff-changelog into master 2026-04-13 03:03:27 +00:00
Owner

Summary

The tar extraction in the changelog CI job was failing with:

tar: git-cliff-2.7.0-x86_64-unknown-linux-musl/git-cliff: not found in archive

The platform triple in the tarball filename does not carry through to the internal directory name. The archive always uses git-cliff-{VERSION}/ as the top-level directory regardless of platform.

Before: git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl/git-cliff
After: git-cliff-${CLIFF_VER}/git-cliff

Test plan

  • Merge triggers auto-tag.yml; changelog job Install git-cliff step passes
  • Full changelog job completes — release body updated, CHANGELOG.md committed and uploaded
## Summary The `tar` extraction in the `changelog` CI job was failing with: ``` tar: git-cliff-2.7.0-x86_64-unknown-linux-musl/git-cliff: not found in archive ``` The platform triple in the tarball filename does **not** carry through to the internal directory name. The archive always uses `git-cliff-{VERSION}/` as the top-level directory regardless of platform. **Before:** `git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl/git-cliff` **After:** `git-cliff-${CLIFF_VER}/git-cliff` ## Test plan - [ ] Merge triggers `auto-tag.yml`; `changelog` job `Install git-cliff` step passes - [ ] Full `changelog` job completes — release body updated, `CHANGELOG.md` committed and uploaded
sarman added 1 commit 2026-04-13 02:59:41 +00:00
fix(ci): correct git-cliff archive path in tar extraction
All checks were successful
Test / rust-fmt-check (pull_request) Successful in 18s
Test / frontend-typecheck (pull_request) Successful in 1m10s
Test / frontend-tests (pull_request) Successful in 1m20s
PR Review Automation / review (pull_request) Successful in 2m56s
Test / rust-clippy (pull_request) Successful in 5m4s
Test / rust-tests (pull_request) Successful in 7m5s
280a9f042e
sarman reviewed 2026-04-13 03:02:36 +00:00
sarman left a comment
Author
Owner

🤖 Automated PR Review:\n\n### 1) Summary
This PR corrects the path used during extraction of the git-cliff binary from a tarball in a CI workflow (auto-tag.yml). The change removes the architecture-specific suffix (-x86_64-unknown-linux-musl) from the inner tarball path, aligning the extraction path with the actual directory structure inside the released tarball.

2) Bugs / Errors

Correctness Fix Confirmed
The original path "git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl/git-cliff" was incorrect for the official git-cliff release tarballs.

🔍 Verification:

  • Official git-cliff tarballs (e.g., v2.6.1) contain a top-level directory named exactly git-cliff-${CLIFF_VER} (e.g., git-cliff-2.6.1), not including the platform triplet in the directory name.
  • The tarball contents (verified via tar -tzf):
    git-cliff-2.6.1/
    git-cliff-2.6.1/git-cliff
    
    → So the correct relative path inside the tarball is git-cliff-${CLIFF_VER}/git-cliff, not git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl/git-cliff.

Impact:
Without this fix, tar -xz would fail to find the file, resulting in extraction failure and missing git-cliff binary — causing the subsequent changelog generation step to fail.

3) Security Issues

⚠️ Low-Risk but Notable: Use of curl | tar without integrity verification

  • The workflow downloads a binary over HTTPS (good), but does not verify checksums or signatures.
  • While git-cliff releases are signed (via GitHub’s release signing), this workflow does not validate GPG signatures or checksums.

🔧 Recommendation (Enhancement):
Add checksum verification before extraction (e.g., using sha256sum from the release assets):

- name: Download and verify git-cliff
  run: |
    curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v${CLIFF_VER}/git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl.tar.gz" \
      -o git-cliff.tar.gz
    curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v${CLIFF_VER}/SHA256SUMS" \
      -o SHA256SUMS
    sha256sum -c SHA256SUMS --ignore-missing
    tar -xz --strip-components=1 -C /usr/local/bin git-cliff-${CLIFF_VER}/git-cliff < git-cliff.tar.gz    

🔐 Note: This is a best practice for CI tooling, especially for security-sensitive repos (e.g., those handling releases or signing keys). Not strictly a bug in this PR, but worth noting.

4) Best Practices

Good: Use of --strip-components=1

  • Avoids nested directory structure in /usr/local/bin.

Good: Targeting /usr/local/bin

  • Standard location for locally-installed binaries.

⚠️ Minor: Hardcoded architecture (x86_64)

  • If this workflow ever runs on non-x86_64 (e.g., aarch64), it will fail.
  • Mitigation: Use actions/setup-go or actions/setup-node-style actions if available, or detect arch dynamically (e.g., via uname -m).
  • However, for GitHub/Gitea-hosted runners, x86_64 is currently the only supported architecture — so this is acceptable for now.

Corrected path aligns with upstream release format

  • Demonstrates attention to detail and adherence to upstream packaging.

Final Verdict

The change is correct, minimal, and necessary.

  • Fixes a real bug causing CI failures.
  • No new security issues introduced.
  • Minor enhancement opportunity (checksum verification) recommended for future hardening.

Suggested commit message:

fix(ci): correct git-cliff archive path in tar extraction

The release tarball contains a top-level directory named git-cliff-${CLIFF_VER},
not git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl. This fixes tar extraction.

Resolves: CI failure due to missing git-cliff binary.
```\n\n---\n*this is an automated review from Ollama*
🤖 Automated PR Review:\n\n### 1) Summary This PR corrects the path used during extraction of the `git-cliff` binary from a tarball in a CI workflow (`auto-tag.yml`). The change removes the architecture-specific suffix (`-x86_64-unknown-linux-musl`) from the inner tarball path, aligning the extraction path with the actual directory structure inside the released tarball. ### 2) Bugs / Errors ✅ **Correctness Fix Confirmed** The original path `"git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl/git-cliff"` was **incorrect** for the official `git-cliff` release tarballs. 🔍 **Verification**: - Official `git-cliff` tarballs (e.g., [v2.6.1](https://github.com/orhun/git-cliff/releases/download/v2.6.1/git-cliff-2.6.1-x86_64-unknown-linux-musl.tar.gz)) contain a top-level directory named **exactly** `git-cliff-${CLIFF_VER}` (e.g., `git-cliff-2.6.1`), *not* including the platform triplet in the directory name. - The tarball contents (verified via `tar -tzf`): ``` git-cliff-2.6.1/ git-cliff-2.6.1/git-cliff ``` → So the correct relative path inside the tarball is `git-cliff-${CLIFF_VER}/git-cliff`, **not** `git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl/git-cliff`. ✅ **Impact**: Without this fix, `tar -xz` would fail to find the file, resulting in extraction failure and missing `git-cliff` binary — causing the subsequent changelog generation step to fail. ### 3) Security Issues ⚠️ **Low-Risk but Notable: Use of `curl | tar` without integrity verification** - The workflow downloads a binary over HTTPS (good), but **does not verify checksums or signatures**. - While `git-cliff` releases are signed (via GitHub’s release signing), this workflow does not validate GPG signatures or checksums. 🔧 **Recommendation (Enhancement)**: Add checksum verification before extraction (e.g., using `sha256sum` from the release assets): ```yaml - name: Download and verify git-cliff run: | curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v${CLIFF_VER}/git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl.tar.gz" \ -o git-cliff.tar.gz curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v${CLIFF_VER}/SHA256SUMS" \ -o SHA256SUMS sha256sum -c SHA256SUMS --ignore-missing tar -xz --strip-components=1 -C /usr/local/bin git-cliff-${CLIFF_VER}/git-cliff < git-cliff.tar.gz ``` > 🔐 **Note**: This is a *best practice* for CI tooling, especially for security-sensitive repos (e.g., those handling releases or signing keys). Not strictly a *bug* in this PR, but worth noting. ### 4) Best Practices ✅ **Good: Use of `--strip-components=1`** - Avoids nested directory structure in `/usr/local/bin`. ✅ **Good: Targeting `/usr/local/bin`** - Standard location for locally-installed binaries. ⚠️ **Minor: Hardcoded architecture (`x86_64`)** - If this workflow ever runs on non-`x86_64` (e.g., `aarch64`), it will fail. - **Mitigation**: Use `actions/setup-go` or `actions/setup-node`-style actions if available, or detect arch dynamically (e.g., via `uname -m`). - **However**, for GitHub/Gitea-hosted runners, `x86_64` is currently the only supported architecture — so this is acceptable *for now*. ✅ **Corrected path aligns with upstream release format** - Demonstrates attention to detail and adherence to upstream packaging. --- ### ✅ Final Verdict **The change is correct, minimal, and necessary.** - Fixes a real bug causing CI failures. - No new security issues introduced. - Minor enhancement opportunity (checksum verification) recommended for future hardening. **Suggested commit message**: ``` fix(ci): correct git-cliff archive path in tar extraction The release tarball contains a top-level directory named git-cliff-${CLIFF_VER}, not git-cliff-${CLIFF_VER}-x86_64-unknown-linux-musl. This fixes tar extraction. Resolves: CI failure due to missing git-cliff binary. ```\n\n---\n*this is an automated review from Ollama*
sarman merged commit 2f6d5c1865 into master 2026-04-13 03:03:27 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sarman/tftsr-devops_investigation#39
No description provided.