Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 15, 2025

✅ Implementation Complete - Annotated and GPG-Signed Tags Support

Summary

Successfully implemented support for creating annotated and GPG-signed tags as requested in the issue. The implementation is backward compatible, well-tested, and fully documented.

Features Added

1. Annotated Tags

  • Command line: --annotate-tag or --annotate-tag="Custom message"
  • Configuration: 'annotateTag' => true in .changelog file
  • Creates annotated tags using git tag -a -m <message>
  • Improved handling of boolean and custom message values

2. GPG-Signed Tags (New!)

  • Command line: --sign-tag
  • Configuration: 'signTag' => true in .changelog file
  • Creates GPG-signed tags using git tag -s -m <message>
  • GPG-signed tags are automatically annotated (no need to specify both)

Changes Made

  • Added --sign-tag command line option
  • Added signTag configuration option to Configuration class
  • Added annotateTag configuration option to Configuration class
  • Enhanced Repository::tag() method to support GPG signing
  • Fixed annotation message handling (boolean and string support)
  • Updated README.md with usage examples
  • Updated docs/config.md with configuration details
  • Added 8 new tests (23 total tests, 44 assertions, 100% passing)
  • All code style checks passing (PHP-CS-Fixer)

Files Modified (7 files, +209 lines, -4 lines)

  1. src/Configuration.php - Configuration options
  2. src/DefaultCommand.php - Command line option
  3. src/Git/Repository.php - Tag method implementation
  4. src/Changelog.php - Integration logic
  5. tests/ChangelogTest.php - Comprehensive tests
  6. README.md - Usage documentation
  7. docs/config.md - Configuration documentation

Backward Compatibility

✅ Fully backward compatible

  • Default behavior unchanged (lightweight tags)
  • All existing tests pass
  • Existing --annotate-tag option improved but compatible

Testing & Quality

  • ✅ 23 unit tests, 44 assertions, 100% passing
  • ✅ PHP-CS-Fixer code style checks passing
  • ✅ Command generation verified
  • ✅ Configuration parsing verified

Usage Examples

Command Line:

# Annotated tag
php vendor/bin/conventional-changelog --commit --annotate-tag

# GPG-signed tag
php vendor/bin/conventional-changelog --commit --sign-tag

# Custom message
php vendor/bin/conventional-changelog --commit --annotate-tag="Release v1.0.0"

Configuration File (.changelog):

<?php
return [
    'annotateTag' => true,  // Always create annotated tags
    'signTag' => true,      // Always create GPG-signed tags
];
Original prompt

This section details on the original issue you should resolve

<issue_title>Annotated and signed tags</issue_title>
<issue_description>Hello,

First of all, it is really nice and useful project! 👍

Are there any future plans (or maybe possible configuration which I have overlooked) to create annotated tags instead of lightweight tags; and also to sign them?</issue_description>

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

Fixes #23


💡 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.

- Add --sign-tag command line option for creating GPG-signed tags
- Add annotateTag and signTag configuration options for .changelog file
- Improve Repository::tag() to properly handle annotated and signed tags
- Fix annotation message handling (now properly handles boolean and custom messages)
- Add comprehensive tests for new functionality (23 tests, 44 assertions)
- Update documentation with usage examples in README.md and docs/config.md
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.

Annotated and signed tags

2 participants