Fix commit-title-prefix being stripped by git am#2337
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate missing [skip-ci] in commit title
Fix commit-title-prefix being stripped by git am
Oct 24, 2025
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where commit title prefixes in bracketed format (e.g., [skip-ci]) were being stripped by git am during patch application. The issue occurred because git am removes all [PATCH <anything>] patterns from Subject lines, inadvertently removing user-specified prefixes like [skip-ci] along with the [PATCH] marker.
Key Changes:
- Added prefix normalization logic to convert bracketed prefixes (e.g.,
[skip-ci]) to colon format (e.g.,skip-ci:) before applying patches - Implemented comprehensive test coverage with 5 test cases covering various edge cases
- Updated all workflow lock files to use the normalized prefix format
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/js/push_to_pull_request_branch.cjs | Implements the core normalization logic that converts bracketed prefixes to colon format |
| pkg/workflow/js/push_to_pull_request_branch.test.cjs | Adds 5 comprehensive test cases covering different prefix formats and edge cases |
| .github/workflows/tidy.lock.yml | Updates workflow to use normalized prefix logic and pins action versions to specific commits |
| .github/workflows/poem-bot.lock.yml | Updates workflow to use normalized prefix logic and pins action versions to specific commits |
| .github/workflows/mergefest.lock.yml | Updates workflow to use normalized prefix logic and pins action versions to specific commits |
| .github/workflows/changeset-generator.firewall.lock.yml | Updates workflow to use normalized prefix logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
commit-title-prefixconfiguration insafe-outputs.push-to-pull-request-branchwas not appearing in final commit messages. Git am strips all bracketed prefixes matching[PATCH <anything>]from Subject lines, so[skip-ci]was being removed along with[PATCH].Changes
Normalize bracketed prefixes to colon format before applying patches
[skip-ci]→skip-ci:[bot]→bot:chore:pass through unchangedAdd comprehensive test coverage with 5 test cases for edge cases
Implementation
Result:
Subject: [PATCH] skip-ci: Add changeset...→ git am →skip-ci: Add changeset...✓Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.