fix: derive valid commit titles for message-only updates#197
Merged
joshjohanning merged 3 commits intoMay 5, 2026
Conversation
When only a squash or merge commit message is configured, the action used to reuse the current repository title setting. That could produce invalid GitHub API combinations such as COMMIT_OR_PR_TITLE + BLANK for squash commits or MERGE_MESSAGE + BLANK for merge commits. Choose a compatible title for the requested message instead, while preserving the current title only when that combination remains valid. Add focused unit coverage for squash-only and merge-only message updates.
a359a00 to
3b908de
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an edge case in updateRepositorySettings() where updating only the squash/merge commit message could reuse an incompatible existing title, leading to GitHub REST API validation failures. It adds helpers to derive a compatible title when only a message is provided, and adds unit tests covering “message-only” updates for squash and merge commits.
Changes:
- Derive a valid squash/merge commit title when only the corresponding commit message is being updated.
- Treat both
nullandundefinedas “not provided” for settings inputs (switching checks to!= null). - Add focused Jest tests for squash-only and merge-only message updates.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Adds title-derivation helpers and updates null/undefined handling for settings application. |
__tests__/index.test.js |
Adds unit coverage for squash-only and merge-only commit message update scenarios. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
…or-message-only-updates
📦 Draft Release CreatedA draft release v2.9.4 has been created for this PR. Next Steps
|
joshjohanning
added a commit
to Wuodan/bulk-github-repo-settings-sync-action
that referenced
this pull request
May 6, 2026
Integrate getValidSquashMergeCommitTitle/getValidMergeCommitTitle from PR joshjohanning#197 into the REPOSITORY_SETTING_FIELDS descriptor table via deriveCompanion function references. Also adopt != null checks from main for consistency.
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.
When only a squash or merge commit message is configured, the action used to reuse the current repository title setting. That could produce invalid GitHub API combinations such as COMMIT_OR_PR_TITLE + BLANK for squash commits or MERGE_MESSAGE + BLANK for merge commits.
Choose a compatible title for the requested message instead, while preserving the current title only when that combination remains valid.
Add focused unit coverage for squash-only and merge-only message updates.