fix: log derived commit title in action output#203
Merged
Conversation
a344881 to
86d093f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #198 by making derived companion commit titles (computed when only a merge/squash commit message is configured) visible in the action’s reported currentSettings and changes, so the logs and summary accurately reflect what is sent to the GitHub API.
Changes:
- Record
currentSettingsandchangesentries for a derived companion title when it differs from the repo’s current title. - Extend existing unit tests to assert the derived title is now surfaced in both
currentSettingsandchanges. - Bump package version and regenerate the coverage badge to reflect the updated artifact/output.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Adds reporting of derived companion title changes alongside message-only updates. |
__tests__/index.test.js |
Updates tests to assert the derived title appears in currentSettings and changes. |
package.json |
Bumps the package version for the behavior/output change. |
package-lock.json |
Keeps lockfile version in sync with package.json. |
badges/coverage.svg |
Updates the generated coverage badge. |
Copilot's findings
- Files reviewed: 3/5 changed files
- Comments generated: 1
When only squash_merge_commit_message or merge_commit_message is set (without an explicit title) and the existing title is invalid for that message, the derived title is now recorded in changes/currentSettings so it appears in action logs and summary output. Fixes #198 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
86d093f to
06aaa90
Compare
📦 Draft Release CreatedA draft release v2.9.6 has been created for this PR. Next Steps
|
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.
Fixes #198 (follow-up from #197).
When only
squash_merge_commit_messageormerge_commit_messageis configured (without an explicit title), the action derives a valid companion title and sends it to the GitHub API. Previously this derived title change was applied silently — it never showed up inchanges/currentSettings, so it was invisible in logs and summary output.Changes
src/index.js: when a derived companion title differs from the current repo title, record both thecurrentSettingsentry and achangesentry alongside the message change.__tests__/index.test.js: extend the two existing "should choose a valid … title when only … message is updated" tests to assert the derived title now appears incurrentSettingsandchanges.Example
Current repo:
squash_merge_commit_title: COMMIT_OR_PR_TITLE, user setssquash_merge_commit_message: BLANK. The action derivesPR_TITLE(sinceCOMMIT_OR_PR_TITLE + BLANKis invalid), and now logs:squash_merge_commit_message: COMMIT_MESSAGES → BLANKsquash_merge_commit_title: COMMIT_OR_PR_TITLE → PR_TITLEValidation
npm run all— 402 tests pass, build + bundle + badges OK.2.9.5 → 2.9.6) since action output behavior changed.