Skip to content

Conversation

@rishitank
Copy link
Owner

@rishitank rishitank commented Jan 5, 2026

Summary

Replaces OpenAI API with git-cliff for changelog generation.

Changes

  • Removed: OpenAI API dependency (no more OPENAI_API_KEY secret needed)
  • Added: git-cliff v2.7.0 (Rust-based changelog generator)
    • Free and open source
    • No API keys required
    • Fast (runs locally in the workflow)
    • Parses conventional commits automatically
    • Categorizes commits with emoji prefixes

How it works

  1. Installs git-cliff from GitHub releases
  2. Creates inline config for conventional commit parsing
  3. Generates categorized changelog with:
    • ✨ Features
    • 🐛 Bug Fixes
    • 🔒 Security
    • 📚 Documentation
    • ⚡ Performance
    • 🎨 Refactoring
    • 🧪 Tests
    • 🔧 Maintenance
    • 📦 Other
  4. Falls back to simple git log if git-cliff fails

Benefits

  • No external API dependencies
  • No secrets to manage
  • Faster execution (no network calls to AI APIs)
  • Deterministic output
  • Written in Rust (matches the project)

Pull Request opened by Augment Code with guidance from the PR author

Summary by CodeRabbit

  • Chores
    • Replaced AI-driven changelog generation with a deterministic git-cliff-based workflow.
    • Added inline configuration and checksum verification for the changelog tool installation.
    • Removed AI/OpenAI-related steps and secrets from the workflow.
    • Ensured changelog is generated from previous tag..HEAD with a git-log fallback and preserved artifact/output handling.

✏️ Tip: You can customise this high-level summary in your review settings.

Previously, when the Release workflow was triggered by workflow_run (after CI
completes on main), it would skip the release if the current version tag already
existed. This required manual version bumps before each release.

Now, when triggered by workflow_run:
- If current version tag doesn't exist → release with current version
- If current version tag exists → auto-bump patch version, update Cargo.toml, then release

This makes releases fully automatic after merging PRs to main.
Uses RELEASE_TOKEN (a PAT with Contents write permission) to bypass
branch protection when auto-bumping the version.

Setup required:
1. Create a Fine-Grained PAT at GitHub Settings → Developer Settings → Personal Access Tokens
2. Grant it 'Contents: Read and write' permission for this repo
3. Add it as a repository secret named RELEASE_TOKEN

The workflow falls back to GITHUB_TOKEN if RELEASE_TOKEN is not set,
which will fail on protected branches but work on unprotected ones.
- Remove OpenAI API dependency for changelog generation
- Use git-cliff (Rust-based, free, no API keys needed)
- Parses conventional commits automatically
- Categorizes commits with emoji prefixes
- Falls back to simple format if git-cliff fails
@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

Walkthrough

Replaces AI-driven changelog generation in the release workflow with a deterministic git-cliff invocation using an inline cliff.toml, installs/verifies git-cliff, generates changelog from PREV_TAG..HEAD with an empty-output fallback to git log, and emits the changelog as an Action output/artifact.

Changes

Cohort / File(s) Summary
Release workflow changelog generation
\.github/workflows/release\.yml
Removes OpenAI/AI-enhancement steps and previous-tag/commit-parsing logic; adds installation and checksum verification for git-cliff (v2.11.0), embeds an inline cliff.toml config, generates changelog from PREV_TAG..HEAD, falls back to git log if output empty, and preserves artifact/output publishing steps

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant Repo as Repository (git)
  participant Tool as git-cliff
  participant Storage as Actions Artifact / Output

  rect rgb(240,248,255)
    GH->>Repo: checkout code
    GH->>Tool: download & verify git-cliff tarball
    GH->>Tool: install git-cliff
  end

  rect rgb(245,255,240)
    GH->>Repo: determine PREV_TAG..HEAD
    GH->>Tool: run git-cliff with inline cliff.toml (PREV_TAG..HEAD)
    Tool-->>GH: changelog.md (may be empty)
  end

  alt changelog non-empty
    GH->>Storage: upload changelog artifact & set output
  else empty output
    GH->>Repo: run fallback `git log` to create basic changelog
    GH->>Storage: upload fallback artifact & set output
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

A rabbit hopped where cliffs compile, 🐇
No oracle, just careful file,
Tags and commits in tidy line,
A changelog born without a sign,
Quiet, deterministic—simply fine.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and clearly summarizes the main change: replacing OpenAI with git-cliff for changelog generation, which is the primary objective of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @.github/workflows/release.yml:
- Around line 227-232: The workflow installs git-cliff v2.7.0 and moves a
downloaded binary to /usr/local/bin without checksum verification; update the
download to a secure, supported release (v2.11.0 or later) and add checksum
validation before installing: change the version string used in the "Install
git-cliff" step, fetch the corresponding release checksum (or .sha256 file) from
the git-cliff releases, validate the downloaded tar.gz against that checksum,
and only then extract and move the binary (still using sudo for /usr/local/bin
if needed); ensure the step fails on checksum mismatch to prevent installing
tampered binaries.
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

287-301: Consider more explicit error handling for git-cliff.

The current implementation only checks if changelog.md is empty, which doesn't distinguish between:

  • git-cliff failing with an error (which might write error messages to the file)
  • git-cliff succeeding but producing no output (e.g., no commits in range)
  • git-cliff succeeding with valid output

Consider capturing the exit code to make the fallback logic more deterministic.

🔎 Proposed improvement
           # Generate changelog for this release
-          git-cliff --config cliff.toml --tag "v${VERSION}" "${PREV_TAG}..HEAD" > changelog.md
+          if ! git-cliff --config cliff.toml --tag "v${VERSION}" "${PREV_TAG}..HEAD" > changelog.md 2>&1; then
+            echo "git-cliff failed, using fallback"
+            {
+              echo "# Release v${VERSION}"
+              echo ""
+              echo "Released on $(date '+%Y-%m-%d')"
+              echo ""
+              echo "### 📦 Changes"
+              echo ""
+              git log "${PREV_TAG}..HEAD" --pretty=format:"- %s (\`%h\`) - @%an"
+            } > changelog.md
+          fi
 
           # If git-cliff fails or produces empty output, fall back to simple format
-          if [ ! -s changelog.md ]; then
+          if [ ! -s changelog.md ]; then
             echo "git-cliff produced empty output, using fallback"
             {
               echo "# Release v${VERSION}"
               echo ""
               echo "Released on $(date '+%Y-%m-%d')"
               echo ""
               echo "### 📦 Changes"
               echo ""
               git log "${PREV_TAG}..HEAD" --pretty=format:"- %s (\`%h\`) - @%an"
             } > changelog.md
           fi
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43d1d17 and b4453e6.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
.github/workflows/release.yml (2)

209-209: LGTM! Clear description of the new approach.

The comment accurately reflects the benefits of replacing OpenAI with git-cliff.


246-284: Well-structured git-cliff configuration.

The inline cliff.toml configuration correctly implements conventional commit parsing with comprehensive type mapping and emoji-prefixed sections. The catch-all pattern at line 280 ensures all commits are captured, and filter_unconventional = false prevents commit exclusion.

- Upgrade git-cliff from v2.7.0 to v2.11.0 to address CVE-2024-32650
- Add SHA512 checksum verification before installing git-cliff binary
- Improve error handling to capture git-cliff exit code
- Distinguish between git-cliff failure vs empty output scenarios
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/release.yml (2)

236-241: Consider adding explicit error handling for download failures.

Whilst the -f flag in curl will cause the step to fail on HTTP errors, adding explicit error messages would improve debuggability when downloads fail.

♻️ Optional improvement for clearer error handling
-          # Download the tarball and checksum
-          curl -sSfL "${DOWNLOAD_URL}/${TARBALL}" -o "${TARBALL}"
-          curl -sSfL "${DOWNLOAD_URL}/${TARBALL}.sha512" -o "${TARBALL}.sha512"
+          # Download the tarball and checksum
+          echo "Downloading git-cliff ${VERSION}..."
+          if ! curl -sSfL "${DOWNLOAD_URL}/${TARBALL}" -o "${TARBALL}"; then
+            echo "Error: Failed to download git-cliff tarball"
+            exit 1
+          fi
+          if ! curl -sSfL "${DOWNLOAD_URL}/${TARBALL}.sha512" -o "${TARBALL}.sha512"; then
+            echo "Error: Failed to download checksum file"
+            exit 1
+          fi

257-262: Previous tag logic is correct but could be more explicit.

The logic properly handles cases where there are multiple tags, one tag, or no tags. However, the fallback to the initial commit might produce a very large changelog for first releases.

💡 Optional: Add explicit handling for first release
           # Get previous tag for range
           PREV_TAG=$(git tag -l 'v*' --sort=-v:refname | head -2 | tail -1)
           if [ -z "$PREV_TAG" ]; then
-            PREV_TAG=$(git rev-list --max-parents=0 HEAD)
+            # For first release, use initial commit
+            PREV_TAG=$(git rev-list --max-parents=0 HEAD)
+            echo "No previous tag found, generating changelog from initial commit"
+          else
+            echo "Found previous tag: $PREV_TAG"
           fi
           echo "Generating changelog from $PREV_TAG to HEAD"
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4453e6 and 9489ece.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (5)
.github/workflows/release.yml (5)

209-209: LGTM!

The comment accurately reflects the benefits of using git-cliff over the previous OpenAI-based approach.


264-302: LGTM!

The git-cliff configuration properly parses conventional commits with appropriate categorisation and emoji prefixes. The catch-all pattern ensures no commits are omitted from the changelog.


304-335: Excellent error handling with comprehensive fallback strategy!

The implementation properly handles both git-cliff failures and empty output scenarios, with clear logging and a robust fallback to git log. The captured exit code (line 306) allows distinguishing between command failure and legitimate empty output.


337-345: LGTM!

The changelog is properly output to GitHub Actions using heredoc syntax and displayed in logs for transparency. The output is correctly consumed by the release job at line 394.


227-250: Excellent security improvements addressing CVE-2024-32650—v2.11.0 is confirmed as the latest stable release.

The upgrade to v2.11.0 (released 14 December 2025) correctly addresses the DoS vulnerability in the rustls dependency, and the addition of SHA512 checksum verification strengthens supply chain security. All claims verified and appropriate.

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.

2 participants