Skip to content

feat: add confirmation prompt and allow patch releases without changesets#1540

Closed
Copilot wants to merge 8 commits intomainfrom
copilot/update-changeset-script
Closed

feat: add confirmation prompt and allow patch releases without changesets#1540
Copilot wants to merge 8 commits intomainfrom
copilot/update-changeset-script

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 11, 2025

Update changeset script with patch release and confirmation features

Summary

Updated the changeset script to add two key features requested in the issue:

  1. Allow patch releases without changeset files
  2. Add user confirmation prompt before executing releases

Note: Main branch also added a confirmation feature, but this PR provides a better implementation that asks for confirmation BEFORE making any file changes (main's version asked AFTER modifying CHANGELOG and deleting changesets).

Changes Made

1. User Confirmation Prompt

  • Added readline module import (built-in Node.js)
  • Created promptConfirmation() async function that prompts with "(y/N)"
  • Modified runRelease() to be async and call confirmation before making any file changes
  • Modified main() to be async to support the async runRelease call

2. Patch Releases Without Changesets

  • Modified logic to allow patch releases even when .changeset/ directory is empty
  • When no changesets exist and no release type specified, defaults to 'patch'
  • Prevents non-patch releases (minor, major) without changeset files with clear error message
  • Updates CHANGELOG only when changesets exist
  • Uses --allow-empty flag for git commits when no changesets present

3. Merged with Main Branch (Multiple Times)

  • First merge (946ea0e): Merged main's confirmation prompt feature
  • Second merge (6d9cd20): Merged documentation and workflow updates
  • Third merge (46ee536): Merged latest documentation tweaks and file reorganization
  • Fourth merge (current): Merged latest workflow improvements and recompiled all workflows
  • Resolved all conflicts by keeping this PR's superior implementation (confirms before changes, not after)
  • Eliminated duplicate code - now only one promptConfirmation function
  • No redundant confirmation prompts

4. Documentation Updates

  • Moved CHANGESET_README.md to scripts/readme.md for better organization
  • Updated documentation with new features
  • Added section on patch releases without changesets
  • Updated release workflow to mention confirmation prompt
  • Updated features list to include new capabilities

5. Workflow Recompilation

  • Recompiled all 64 workflow files after merge
  • All workflows validated against GitHub Actions schema
  • Updated .gitattributes for generated lock files

Testing

✓ All manual tests passing
✓ Help command works correctly
✓ Version command with/without changesets
✓ Logic correctly defaults to patch for no changesets
✓ Logic correctly prevents minor/major without changesets
✓ Confirmation prompt works with readline module
✓ No duplicate functions after merges
✓ All workflows recompiled successfully

Checklist

  • Understand the current changeset.js implementation
  • Modify runRelease() to allow patch releases without changeset files
  • Add user confirmation prompt before executing release
  • Use Node.js built-in readline module for user input
  • Test the changes manually
  • Update documentation
  • Merge main branch (first time - 946ea0e)
  • Ensure no duplicate features
  • Move documentation to scripts/readme.md
  • Merge main branch (second time - 6d9cd20)
  • Merge main branch (third time - 46ee536)
  • Merge main branch and recompile (fourth time - current)
Original prompt

Update the changeset script:

  • allow patch releases without changeset
  • confirm the new version number with the user before executing (use built-in nodejs"

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 11, 2025 15:09
…sets

- Added user confirmation prompt using Node.js readline module
- Allow patch releases without changesets (defaults to patch when no changesets)
- Prevent non-patch releases without changesets
- Made runRelease and main functions async to support prompts

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Document confirmation prompt feature
- Document patch releases without changesets
- Update release workflow section
- Update features list

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main and make sure there is not duplicate features in the script

Copilot AI changed the title [WIP] Update changeset script to allow patch releases and confirm version feat: add confirmation prompt and allow patch releases without changesets Oct 11, 2025
Copilot AI requested a review from pelikhan October 11, 2025 15:15
Resolved merge conflict by keeping the improved implementation:
- Single promptConfirmation function with readline imported at top
- Confirmation prompt BEFORE any file changes (not after)
- Support for patch releases without changesets preserved
- No duplicate code or redundant prompts

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 11, 2025

@copilot merge main and make sure there is not duplicate features in the script

Merged main and resolved conflicts in commit 946ea0e.

Key changes:

  • Removed duplicate promptConfirmation function (main had one too)
  • Kept this PR's superior implementation: confirmation prompt BEFORE file changes (main's version asked AFTER modifying CHANGELOG)
  • All features preserved: patch releases without changesets + user confirmation
  • No duplicate code remaining

@pelikhan pelikhan marked this pull request as ready for review October 11, 2025 15:41
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot move changeset-readme file to scripts/readme.md

Relocated the changeset documentation to be co-located with the changeset.js script in the scripts directory.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 11, 2025

@copilot move changeset-readme file to scripts/readme.md

Moved in commit that will be pushed with progress report. The file has been relocated from CHANGESET_README.md to scripts/readme.md to be co-located with the changeset.js script.

Copilot AI requested a review from pelikhan October 11, 2025 15:46
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main

Merged latest changes from main including:
- Documentation updates
- CLI version checker workflow enhancements
- Schema updates

Resolved merge conflict in scripts/changeset.js by keeping this PR's superior implementation:
- Confirmation prompt BEFORE file changes (not after)
- Support for patch releases without changesets
- No duplicate code

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 11, 2025

@copilot merge main

Merged main (up to commit 17cbe5e) in the commit being pushed. Resolved conflict in scripts/changeset.js by keeping this PR's implementation (confirmation before file changes). All features preserved.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main

Merged latest changes from main including:
- Documentation tweaks and improvements across multiple files
- File reorganization (custom-safe-outputs moved to guides)
- New documentation files added

Resolved merge conflicts:
- scripts/changeset.js: Kept this PR's implementation (confirmation before file changes)
- Documentation files: Accepted main's updated versions
- All features preserved, no duplicate code

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 11, 2025

@copilot merge main

Merged main (up to commit 8306374) in the commit being pushed. Resolved conflicts in scripts/changeset.js by keeping this PR's implementation and accepted main's documentation updates. All features preserved.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main, recompile

Merged latest changes from main including:
- New changesets for recent features
- GitHub Copilot agent setup workflow
- Cache-memory and PR conflict checking in unbloat-docs
- Heredoc delimiter fix for GitHub Actions expressions
- Various workflow improvements and updates

Resolved merge conflicts:
- scripts/changeset.js: Kept this PR's implementation (confirmation before file changes)
- docs/src/content/docs/reference/triggers.md: Accepted main's version

Recompiled all workflows:
- Successfully recompiled 64 workflow files
- All workflows validated against GitHub Actions schema
- Updated .gitattributes for generated files

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 11, 2025

@copilot merge main, recompile

Merged main (up to commit 51fb523) and recompiled all 64 workflows in the commit being pushed. Resolved conflicts in scripts/changeset.js by keeping this PR's implementation. All workflows validated successfully.

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.

2 participants