Conversation
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.
There was a problem hiding this comment.
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}" |
There was a problem hiding this comment.
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.
| 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/'; \ |
There was a problem hiding this comment.
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.
| paths-ignore: | ||
| - 'CHANGELOG.md' | ||
| - 'docs/**' | ||
| - '**.md' |
There was a problem hiding this comment.
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.
|
fizzy |
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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
| @echo "" | ||
| @read -p "Update CHANGELOG.md? [y/N] " -n 1 -r; echo; \ | ||
| if [[ $$REPLY =~ ^[Yy]$$ ]]; then \ | ||
| cp CHANGELOG.md CHANGELOG.md.bak; \ |
There was a problem hiding this comment.
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.
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
Related Issues
Closes #
How Has This Been Tested?
Test environment:
Checklist
Security Considerations
Screenshots (if applicable)