Skip to content

Conversation

Copy link

Copilot AI commented Oct 4, 2025

Release Note Automation - Complete ✅

Implementation Complete:

  • Analyze repository structure (monorepo with apps/ and packages/)
  • Understand existing deployment workflows
  • Create GitHub Actions workflow to detect package.json version changes
  • Implement tag creation with format: @apps//@Version or @packages/@Version
  • Implement automatic release note generation
  • Add required permissions for tag and release creation
  • Test and validate workflow syntax
  • Add comprehensive documentation
  • Update main README with release automation section
  • Add practical examples and troubleshooting guide
  • Apply review feedback and improvements

Recent Changes (Review Feedback):

Workflow Improvements:

  • Changed fetch-depth: 2 to fetch-depth: 0 for full history (handles edge cases with new branches)
  • Added quotes to prev_tag variable in git log command (security fix for command injection)
  • Improved fallback for changed files detection using git diff-tree for initial commits
  • Added support for initial releases (packages without previous versions)
  • Fixed tag pattern matching to use full package path for accurate previous tag lookup

Documentation Fixes:

  • Corrected relative path in release-automation-example.md

Files Created/Modified:

  1. .github/workflows/release-automation.yml (UPDATED)

    • More robust change detection
    • Better handling of edge cases (new branches, initial commits)
    • Improved security with proper variable quoting
    • Support for initial releases
    • Accurate previous tag detection
  2. .docs/release-automation.md

    • Complete guide on how automation works
  3. .docs/release-automation-example.md (UPDATED)

    • Fixed documentation links
  4. README.MD

    • Added Release Automation section

Tag Format:

  • Apps: @apps/[frontend|server|cli]/<app-name>@x.y.z
  • Packages: @packages/<package-name>@x.y.z

Example Usage:

# 1. Update version
cd apps/frontend/tool
npm version patch  # 0.3.0 -> 0.3.1

# 2. Commit and push
git commit -m "chore: bump tool to 0.3.1"
git push origin main

# 3. Automation creates:
# - Tag: @apps/frontend/[email protected]
# - GitHub Release with notes
Original prompt

This section details on the original issue you should resolve

<issue_title>chore: release note 작성 자동화</issue_title>
<issue_description>- tag를 이용하여 릴리즈

  • @apps/[frontend|server|cli]/<app-name>@x.y.z

  • @packages/<package-name>@x.y.z

  • 깃헙 액션을 이용하여 각 도메인별 pacakage.json의 버전이 변경된 커밋이 포함 발샹할 경우 릴리즈 태그, 릴리즈 노트 자동 작성</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #35

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] chore: release note 작성 자동화 chore: Implement automated release note generation with GitHub Actions Oct 4, 2025
Copilot AI requested a review from 99mini October 4, 2025 15:27
@99mini 99mini marked this pull request as ready for review October 29, 2025 12:16
@99mini 99mini requested a review from Copilot October 29, 2025 12:16
Copy link
Contributor

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 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
Copy link

Copilot AI Oct 29, 2025

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.

Suggested change
fetch-depth: 2 # Need at least 2 commits to compare
fetch-depth: 0 # Fetch full history to ensure diffs work reliably

Copilot uses AI. Check for mistakes.
# 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/^/- /'
Copy link

Copilot AI Oct 29, 2025

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\"

Suggested change
git log ${prev_tag}..HEAD --oneline -- "$package_path" | sed 's/^/- /'
git log "${prev_tag}"..HEAD --oneline -- "$package_path" | sed 's/^/- /'

Copilot uses AI. Check for mistakes.

# 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)
Copy link

Copilot AI Oct 29, 2025

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
Comment on lines 153 to 154
if [ "$current_version" != "$previous_version" ] && [ -n "$previous_version" ]; then
echo " Version changed! Creating release..."
Copy link

Copilot AI Oct 29, 2025

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.

Suggested change
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..."

Copilot uses AI. Check for mistakes.
fi

# Find previous tag for this package
prev_tag=$(git tag -l "*${package_name##*/}@*" --sort=-version:refname | head -n 1 || echo "")
Copy link

Copilot AI Oct 29, 2025

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.

Suggested change
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 "")

Copilot uses AI. Check for mistakes.

## Related Documentation

- [Release Automation Guide](.docs/release-automation.md)
Copy link

Copilot AI Oct 29, 2025

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.

Suggested change
- [Release Automation Guide](.docs/release-automation.md)
- [Release Automation Guide](./release-automation.md)

Copilot uses AI. Check for mistakes.
@99mini
Copy link
Owner

99mini commented Oct 31, 2025

@copilot apply changes based on the comments in this thread

Copy link
Author

Copilot AI commented Oct 31, 2025

@copilot apply changes based on the comments in this thread

Applied all changes from the review feedback in commit 78e9d1f:

  1. ✅ Changed fetch-depth to 0 for full history
  2. ✅ Added quotes to prev_tag variable for security
  3. ✅ Improved fallback using git diff-tree
  4. ✅ Added support for initial releases
  5. ✅ Fixed tag pattern matching with full package path
  6. ✅ Corrected documentation relative path

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.

chore: release note 작성 자동화

2 participants