-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Implement automated release note generation with GitHub Actions #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: 99mini <[email protected]>
Co-authored-by: 99mini <[email protected]>
Co-authored-by: 99mini <[email protected]>
Co-authored-by: 99mini <[email protected]>
There was a problem hiding this 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 release creation for the Voyage monorepo. When package.json versions are updated, a GitHub Actions workflow automatically creates git tags and GitHub releases with generated release notes.
- Added GitHub Actions workflow for automated release management
- Created comprehensive documentation explaining the release process
- Updated README with release automation section
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/release-automation.yml | Implements the automated workflow that detects version changes and creates releases with tags |
| .docs/release-automation.md | Provides detailed documentation on how the release automation works |
| .docs/release-automation-example.md | Contains practical examples for creating releases |
| README.MD | Adds link to release automation documentation in the table of contents |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 # Need at least 2 commits to compare |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using fetch-depth: 2 may fail when the workflow triggers on the first commit of a new branch or when there are merge commits. This will cause git diff HEAD~1 HEAD on line 108 to fail. Consider using fetch-depth: 0 to fetch the full history, or add fallback logic to handle cases where HEAD~1 doesn't exist.
| fetch-depth: 2 # Need at least 2 commits to compare | |
| fetch-depth: 0 # Fetch full history to ensure diffs work reliably |
| # Get commits for this package since last tag | ||
| if [ -n "$prev_tag" ]; then | ||
| echo "### Commits since ${prev_tag}" | ||
| git log ${prev_tag}..HEAD --oneline -- "$package_path" | sed 's/^/- /' |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable prev_tag is used without quotes in the git log command, making it vulnerable to command injection if the tag name contains special characters. Wrap the variable in quotes: git log \"${prev_tag}\"..HEAD --oneline -- \"$package_path\"
| git log ${prev_tag}..HEAD --oneline -- "$package_path" | sed 's/^/- /' | |
| git log "${prev_tag}"..HEAD --oneline -- "$package_path" | sed 's/^/- /' |
|
|
||
| # Get changed files in the last commit | ||
| changed_files="" | ||
| changed_files=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff --name-only HEAD) |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback command git diff --name-only HEAD compares the working directory to HEAD, not the actual changes in the commit. For new branches or initial commits, consider using git diff-tree --no-commit-id --name-only -r HEAD or git show --name-only --pretty=format: HEAD to list files in the current commit.
| changed_files=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff --name-only HEAD) | |
| changed_files=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff-tree --no-commit-id --name-only -r HEAD) |
| if [ "$current_version" != "$previous_version" ] && [ -n "$previous_version" ]; then | ||
| echo " Version changed! Creating release..." |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition requires previous_version to be non-empty, which means new packages without a previous version will never trigger a release. If the intention is to support initial releases, the logic should also handle the case where previous_version is empty but current_version exists.
| if [ "$current_version" != "$previous_version" ] && [ -n "$previous_version" ]; then | |
| echo " Version changed! Creating release..." | |
| if { [ "$current_version" != "$previous_version" ] && [ -n "$previous_version" ]; } || { [ -z "$previous_version" ] && [ -n "$current_version" ]; }; then | |
| echo " Version changed or initial release! Creating release..." |
| fi | ||
|
|
||
| # Find previous tag for this package | ||
| prev_tag=$(git tag -l "*${package_name##*/}@*" --sort=-version:refname | head -n 1 || echo "") |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern *${package_name##*/}@* extracts only the last part of the package name after '/', but for scoped packages like '@voyage/tool', this will incorrectly match tags. This could return incorrect previous tags or fail to find the correct one. Consider using the full package directory path pattern or a more specific matching strategy based on the tag naming convention.
| prev_tag=$(git tag -l "*${package_name##*/}@*" --sort=-version:refname | head -n 1 || echo "") | |
| prev_tag=$(git tag -l "${package_name}@*" --sort=-version:refname | head -n 1 || echo "") |
.docs/release-automation-example.md
Outdated
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Release Automation Guide](.docs/release-automation.md) |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relative path is incorrect. Since this file is located in .docs/, the reference should be ./release-automation.md (without the .docs/ prefix) or use an absolute path from the repository root.
| - [Release Automation Guide](.docs/release-automation.md) | |
| - [Release Automation Guide](./release-automation.md) |
|
@copilot apply changes based on the comments in this thread |
…mentation Co-authored-by: 99mini <[email protected]>
Applied all changes from the review feedback in commit 78e9d1f:
|
Release Note Automation - Complete ✅
Implementation Complete:
Recent Changes (Review Feedback):
Workflow Improvements:
fetch-depth: 2tofetch-depth: 0for full history (handles edge cases with new branches)prev_tagvariable in git log command (security fix for command injection)git diff-treefor initial commitsDocumentation Fixes:
Files Created/Modified:
.github/workflows/release-automation.yml(UPDATED).docs/release-automation.md.docs/release-automation-example.md(UPDATED)README.MDTag Format:
@apps/[frontend|server|cli]/<app-name>@x.y.z@packages/<package-name>@x.y.zExample Usage:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.