Skip to content

feat: add automated changelog generation system#25

Merged
jacksonkasi1 merged 4 commits intomainfrom
dev
Aug 16, 2025
Merged

feat: add automated changelog generation system#25
jacksonkasi1 merged 4 commits intomainfrom
dev

Conversation

@jacksonkasi1
Copy link
Copy Markdown
Owner

@jacksonkasi1 jacksonkasi1 commented Aug 16, 2025

Summary

  • Add CHANGELOG.md with proper formatting and recent changes
  • Add GitHub Actions workflow for automatic changelog updates on merge
  • Workflow categorizes commits by type (feat/fix/refactor) into changelog sections

Test plan

  • Verify CHANGELOG.md format follows Keep a Changelog standard
  • Test GitHub Actions workflow triggers on merge to main
  • Confirm changelog updates automatically categorize changes

🤖 Generated with Claude Code


EntelligenceAI PR Summary

Automates changelog updates and introduces structured release documentation.

  • Added a GitHub Actions workflow for automatic changelog updates (.github/workflows/changelog.yml)
  • Created CHANGELOG.md with initial and unreleased entries using Keep a Changelog format

- Add CHANGELOG.md with proper formatting and recent changes
- Add GitHub Actions workflow for automatic changelog updates on merge
- Workflow categorizes commits by type (feat/fix/refactor) into changelog sections

🤖 Generated with [Claude Code](https://claude.ai/code)

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

vercel Bot commented Aug 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
data-table Ready Ready Preview Comment Aug 16, 2025 6:12pm

@entelligence-ai-pr-reviews
Copy link
Copy Markdown

Walkthrough

This pull request introduces automated changelog management to the project. A new GitHub Actions workflow is added to update the CHANGELOG.md file on every push to the main branch, ensuring that release notes are always current. The changelog itself is initialized using the Keep a Changelog format, documenting both the initial release and recent unreleased changes. This automation streamlines release documentation and enforces consistency in change tracking.

Changes

File(s) Summary
.github/workflows/changelog.yml Added a GitHub Actions workflow to automatically update the CHANGELOG.md on every push to main, parsing commit messages and PR details to categorize changes.
CHANGELOG.md Introduced a changelog file following the Keep a Changelog format, documenting the initial release and recent unreleased changes.

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    title Changelog Update Workflow on Merge to Main

    actor Developer
    participant GitHub as "GitHub"
    participant WorkflowRunner as "GitHub Action Runner"
    participant Git as "Git Commands"
    participant GH_CLI as "GitHub CLI"
    participant Filesystem as "Filesystem"

    Developer->>GitHub: Merge PR to main branch
    GitHub->>WorkflowRunner: Trigger "Update Changelog on Merge" workflow
    
    Note over WorkflowRunner: Job: update-changelog

    WorkflowRunner->>Git: Checkout code (actions/checkout@v4)
    
    WorkflowRunner->>Git: Get latest merge commit info
    Git-->>WorkflowRunner: Return merge message, hash, date
    
    WorkflowRunner->>WorkflowRunner: Extract PR number from merge message
    
    alt PR number found
        WorkflowRunner->>GH_CLI: Request PR details (title, body)
        GH_CLI-->>WorkflowRunner: Return PR details
    end
    
    WorkflowRunner->>Filesystem: Create backup of CHANGELOG.md
    
    WorkflowRunner->>Filesystem: Extract changelog sections
    Filesystem-->>WorkflowRunner: Return section positions
    
    WorkflowRunner->>Git: Get commits from the merge
    Git-->>WorkflowRunner: Return commit list
    
    WorkflowRunner->>WorkflowRunner: Categorize changes
    Note over WorkflowRunner: Loop through commits
    loop For each commit
        alt commit contains "feat:" or "add:"
            WorkflowRunner->>WorkflowRunner: Add to ADDED category
        else commit contains "fix:"
            WorkflowRunner->>WorkflowRunner: Add to FIXED category
        else commit contains "refactor:" or "update:"
            WorkflowRunner->>WorkflowRunner: Add to CHANGED category
        else other commit type
            WorkflowRunner->>WorkflowRunner: Default to CHANGED category
        end
    end
    
    WorkflowRunner->>Filesystem: Build new changelog content
    Note over WorkflowRunner: Add categorized changes to Unreleased section
    
    WorkflowRunner->>Git: Configure git user
    
    WorkflowRunner->>Git: Check for changes in CHANGELOG.md
    Git-->>WorkflowRunner: Return diff status
    
    alt Changes detected
        WorkflowRunner->>Git: Commit updated CHANGELOG.md
        WorkflowRunner->>Git: Push changes to repository
        Git-->>GitHub: Update repository with new commit
    else No changes
        Note over WorkflowRunner: No action needed
    end
Loading

▶️AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

Comment on lines +38 to +40
# Get PR details using GitHub CLI
PR_TITLE=$(gh pr view $PR_NUM --json title --jq .title || echo "")
PR_BODY=$(gh pr view $PR_NUM --json body --jq .body || echo "")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

correctness: gh pr view is used without ensuring the GitHub CLI is installed, which will cause the workflow to fail with a command not found error if gh is not present.

🤖 AI Agent Prompt for Cursor/Windsurf

📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue

In .github/workflows/changelog.yml, lines 38-40, the workflow uses `gh pr view` without checking if the GitHub CLI is installed, which will cause a runtime failure if `gh` is missing. Add a check before these lines to ensure `gh` is installed, and fail with a clear error message if not.

- name: Update changelog
run: |
# Create backup of current changelog
cp CHANGELOG.md CHANGELOG.md.bak
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

correctness: If CHANGELOG.md does not exist, the workflow will fail with a 'No such file or directory' error when attempting to copy or read it.

🤖 AI Agent Prompt for Cursor/Windsurf

📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue

In .github/workflows/changelog.yml, line 54, the workflow assumes CHANGELOG.md exists and will fail if it does not. Add a check before copying to ensure the file exists, and exit with an error if not.
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
cp CHANGELOG.md CHANGELOG.md.bak
0054 [+]: if [ ! -f CHANGELOG.md ]; then
0055 [+]: echo "CHANGELOG.md not found. Please ensure it exists before running this workflow." >&2
0056 [+]: exit 1
0057 [+]: fi
0058 [+]: cp CHANGELOG.md CHANGELOG.md.bak

Comment on lines +57 to +58
UNRELEASED_START=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
NEXT_VERSION_START=$(tail -n +$((UNRELEASED_START + 1)) CHANGELOG.md | grep -n "## \[" | head -1 | cut -d: -f1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

correctness: If the '## [Unreleased]' section is missing from CHANGELOG.md, the script will set UNRELEASED_START to empty, causing subsequent commands to fail with invalid line numbers.

🤖 AI Agent Prompt for Cursor/Windsurf

📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue

In .github/workflows/changelog.yml, lines 57-58, the script assumes the '## [Unreleased]' section exists in CHANGELOG.md. Add a check after setting UNRELEASED_START to ensure it is not empty, and exit with an error if the section is missing.
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
UNRELEASED_START=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
NEXT_VERSION_START=$(tail -n +$((UNRELEASED_START + 1)) CHANGELOG.md | grep -n "## \[" | head -1 | cut -d: -f1)
0057 [+]: UNRELEASED_START=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
0058 [+]: if [ -z "$UNRELEASED_START" ]; then
0059 [+]: echo "## [Unreleased] section not found in CHANGELOG.md. Please add it before running this workflow." >&2
0060 [+]: exit 1
0061 [+]: fi
0062 [+]: NEXT_VERSION_START=$(tail -n +$((UNRELEASED_START + 1)) CHANGELOG.md | grep -n "## \[" | head -1 | cut -d: -f1)

- Change trigger from push to pull_request with closed type
- Add condition to only run when PR is actually merged
- This ensures changelog updates when dev is merged to main via PR

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@entelligence-ai-pr-reviews
Copy link
Copy Markdown

Review Summary

🔍 Comments beyond diff scope (1)
.github/workflows/changelog.yml (1)

6-7: branches: is incorrectly nested under the pull_request event, causing the workflow to never trigger on PR merges to main.
Category: correctness


@entelligence-ai-pr-reviews
Copy link
Copy Markdown

LGTM 👍

jacksonkasi1 and others added 2 commits August 16, 2025 23:40
- Add command check for 'gh' before using GitHub CLI commands
- Provide clear error message if GitHub CLI is not installed
- Prevents runtime failure on lines 38-40 when gh is missing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Check if CHANGELOG.md exists before attempting to copy/process
- Verify '## [Unreleased]' section exists before proceeding
- Provide clear error messages for missing file or invalid format
- Prevents runtime failures on lines 63 and 73-74

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@entelligence-ai-pr-reviews
Copy link
Copy Markdown

LGTM 👍

Comment on lines +73 to +80
UNRELEASED_START=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)

# Check if Unreleased section exists
if [ -z "$UNRELEASED_START" ]; then
echo "ERROR: '## [Unreleased]' section not found in CHANGELOG.md"
echo "Please ensure CHANGELOG.md follows the Keep a Changelog format with an Unreleased section"
exit 1
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

correctness: UNRELEASED_START will be empty and script will exit if '## [Unreleased]' is present but with different casing or extra whitespace, causing false negatives and blocking changelog updates.

🤖 AI Agent Prompt for Cursor/Windsurf

📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue

In .github/workflows/changelog.yml, lines 73-80: The script checks for the '## [Unreleased]' section using a case-sensitive grep, which will fail if the section header uses different casing or extra whitespace. Update the grep command to be case-insensitive and match the section at the start of the line, so that the script reliably finds the Unreleased section regardless of casing or leading spaces.
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
UNRELEASED_START=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
# Check if Unreleased section exists
if [ -z "$UNRELEASED_START" ]; then
echo "ERROR: '## [Unreleased]' section not found in CHANGELOG.md"
echo "Please ensure CHANGELOG.md follows the Keep a Changelog format with an Unreleased section"
exit 1
fi
UNRELEASED_START=$(grep -in "^## \[unreleased\]" CHANGELOG.md | cut -d: -f1)
# Check if Unreleased section exists
if [ -z "$UNRELEASED_START" ]; then
echo "ERROR: '## [Unreleased]' section not found in CHANGELOG.md"
echo "Please ensure CHANGELOG.md follows the Keep a Changelog format with an Unreleased section"
exit 1
fi

@jacksonkasi1 jacksonkasi1 merged commit a65791e into main Aug 16, 2025
2 of 3 checks passed
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