Skip to content

fix: log derived commit title in action output#203

Merged
joshjohanning merged 1 commit into
mainfrom
joshjohanning/log-derived-commit-title
May 19, 2026
Merged

fix: log derived commit title in action output#203
joshjohanning merged 1 commit into
mainfrom
joshjohanning/log-derived-commit-title

Conversation

@joshjohanning

Copy link
Copy Markdown
Owner

Fixes #198 (follow-up from #197).

When only squash_merge_commit_message or merge_commit_message is 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 in changes / 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 the currentSettings entry and a changes entry 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 in currentSettings and changes.

Example

Current repo: squash_merge_commit_title: COMMIT_OR_PR_TITLE, user sets squash_merge_commit_message: BLANK. The action derives PR_TITLE (since COMMIT_OR_PR_TITLE + BLANK is invalid), and now logs:

  • squash_merge_commit_message: COMMIT_MESSAGES → BLANK
  • squash_merge_commit_title: COMMIT_OR_PR_TITLE → PR_TITLE

Validation

  • npm run all — 402 tests pass, build + bundle + badges OK.
  • Patch version bump (2.9.5 → 2.9.6) since action output behavior changed.

Copilot AI review requested due to automatic review settings May 19, 2026 19:46
@joshjohanning joshjohanning force-pushed the joshjohanning/log-derived-commit-title branch from a344881 to 86d093f Compare May 19, 2026 19:46
@joshjohanning joshjohanning changed the title Log derived commit title when only commit message is configured feat: log derived commit title when only commit message is configured May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 currentSettings and changes entries 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 currentSettings and changes.
  • 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

Comment thread package.json
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>
@joshjohanning joshjohanning force-pushed the joshjohanning/log-derived-commit-title branch from 86d093f to 06aaa90 Compare May 19, 2026 19:50
@joshjohanning joshjohanning changed the title feat: log derived commit title when only commit message is configured fix: log derived commit title in action output May 19, 2026
@joshjohanning joshjohanning merged commit 884f113 into main May 19, 2026
4 checks passed
@joshjohanning joshjohanning deleted the joshjohanning/log-derived-commit-title branch May 19, 2026 19:51
@github-actions

Copy link
Copy Markdown

📦 Draft Release Created

A draft release v2.9.6 has been created for this PR.

🔗 View Draft Release

Next Steps

  • Review the release notes
  • Publish the release to make it permanent

This is an automated reminder from the publish-github-action workflow.

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.

Nit: Log derived commit title

2 participants