Skip to content

Add automated changelog and release management#28

Open
shawntz wants to merge 6 commits intomainfrom
chore/release-automation
Open

Add automated changelog and release management#28
shawntz wants to merge 6 commits intomainfrom
chore/release-automation

Conversation

@shawntz
Copy link
Copy Markdown
Owner

@shawntz shawntz commented Dec 19, 2025

Description

Introduce scripts and workflows for automated changelog generation and release creation using conventional commits. Adds GitHub Actions workflow to update the [Unreleased] section in CHANGELOG.md, Makefile targets for changelog and release, and documentation for the release process. Updates CONTRIBUTING.md with commit message guidelines and expands scripts/README.md with release management instructions.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Closes #

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing

Test environment:

  • OS:
  • Go version:

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Security Considerations

  • This PR does not introduce any security concerns
  • I have considered the security implications and addressed them

Screenshots (if applicable)

Introduce scripts and workflows for automated changelog generation and release creation using conventional commits. Adds GitHub Actions workflow to update the [Unreleased] section in CHANGELOG.md, Makefile targets for changelog and release, and documentation for the release process. Updates CONTRIBUTING.md with commit message guidelines and expands scripts/README.md with release management instructions.
@shawntz shawntz self-assigned this Dec 19, 2025
Copilot AI review requested due to automatic review settings December 19, 2025 09:40
@shawntz shawntz added documentation Improvements or additions to documentation ci/cd devops labels Dec 19, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces automated changelog generation and release management infrastructure for the cassh project. It leverages conventional commits to automatically categorize changes and streamline the release process through scripts and GitHub Actions workflows.

Key Changes:

  • Adds bash scripts for generating changelogs from git commits and creating releases interactively
  • Implements GitHub Actions workflow to automatically update the CHANGELOG.md [Unreleased] section on pushes to main
  • Extends Makefile with new targets for changelog preview, update, and release creation

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
scripts/generate-changelog New bash script that parses git commits using conventional commit format and generates changelog entries categorized by type
scripts/create-release Interactive release script that generates changelog, updates CHANGELOG.md, creates tags, and pushes to trigger automated builds
scripts/README.md Adds documentation for the new release management scripts with usage examples
docs/releases.md Comprehensive documentation covering commit conventions, automated workflows, release process, troubleshooting, and best practices
Makefile Adds three new targets: changelog-preview, changelog, and create-release for release management (contains unresolved merge conflict)
CONTRIBUTING.md Updates commit message guidelines to explain conventional commits format with examples and types
.github/workflows/changelog.yml GitHub Actions workflow that automatically updates CHANGELOG.md on every push to main with changes since the last tag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

commit_msg=$(echo "$line" | cut -d' ' -f2-)

# Capitalize first letter
commit_msg="$(echo "${commit_msg:0:1}" | tr '[:lower:]' '[:upper:]')${commit_msg:1}"
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Same issue as line 72: the capitalization logic will fail for empty commit messages. When a commit message is only whitespace or becomes empty after processing, "${commit_msg:0:1}" will fail on an empty string. Add a check to ensure commit_msg is not empty before attempting to capitalize it.

Copilot uses AI. Check for mistakes.
sed -n '1,/## \[Unreleased\]/p' CHANGELOG.md | head -n -1; \
cat /tmp/changelog-unreleased.md; \
echo ""; \
sed -n '/## \[Unreleased\]/,$$ { /## \[Unreleased\]/d; /^$$/d; p }' CHANGELOG.md | sed '1,/^## \[/d' | sed '1s/^/\n/'; \
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

This complex sed pipeline for updating CHANGELOG.md is duplicated across multiple places (here, in the workflow, and in create-release script). The logic is fragile and hard to maintain. Consider extracting this into a dedicated script or function that can be reused consistently across all three locations.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
paths-ignore:
- 'CHANGELOG.md'
- 'docs/**'
- '**.md'
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The paths-ignore configuration will exclude all markdown files from triggering the workflow. This means that changes to non-documentation markdown files (if any exist) will also be ignored. More critically, this creates a potential infinite loop: if the workflow commits to CHANGELOG.md and the push includes other non-markdown code changes, it could trigger itself again. Consider a more specific approach or ensure the workflow checks for the commit author to avoid loops.

Copilot uses AI. Check for mistakes.
@shawntz
Copy link
Copy Markdown
Owner Author

shawntz commented Jan 1, 2026

fizzy

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 11, 2026 08:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
shawntz and others added 3 commits January 11, 2026 00:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

Makefile:39

  • This file contains a merge conflict that needs to be resolved before merging. The conflict markers (<<<<<<, =======, >>>>>>>) indicate that there are conflicting changes in the .PHONY target list between the upstream and stashed changes.
        test test-race test-coverage test-ci test-list \
        test-ca test-config test-memes test-menubar \
        lint \
        changelog changelog-preview create-release

# Default: build all binaries
all: deps build


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +323 to +326
@echo ""
@read -p "Update CHANGELOG.md? [y/N] " -n 1 -r; echo; \
if [[ $$REPLY =~ ^[Yy]$$ ]]; then \
cp CHANGELOG.md CHANGELOG.md.bak; \
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The changelog target writes to a predictable file in /tmp (/tmp/changelog-unreleased.md), which can be exploited on multi-user systems when run with elevated privileges: another user can pre-create this path as a symlink to an arbitrary file (e.g., /etc/passwd), causing that file to be truncated or overwritten when the redirect occurs. To avoid this, use a securely created temporary file (e.g., via mktemp in a private directory or within the repository) rather than a fixed name under a world-writable directory like /tmp.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd devops documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants