Skip to content

feat: automatic commit message for pull request merge (#79) - #120

Merged
gerchowl merged 5 commits into
devfrom
feature/79-auto-merge-commit-message
Feb 20, 2026
Merged

gerchowl merged 5 commits into
devfrom
feature/79-auto-merge-commit-message

Conversation

@gerchowl

Copy link
Copy Markdown
Contributor

Pull Request

Description

Ensure merge commits follow the project's commit message standard automatically. PR titles are validated in CI, GitHub repo settings are configured to use PR title as merge commit subject and PR body as merge commit body, and the PR template includes a Refs: placeholder for traceability.

Related Issue(s)

Closes #79

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • CI / Build change
  • Test updates

Changes Made

  • validate-commit-msg --subject-only flag — validates only the subject line (type, scope, description), skipping body and Refs. Enables PR title validation without requiring a full commit message. 12 new tests added.
  • setup-gh-repo.sh — new devcontainer lifecycle script that configures GitHub repo merge settings via gh api (merge_commit_title=PR_TITLE, merge_commit_message=PR_BODY, allow_auto_merge=true). Wired into post-create.sh so downstream projects get compliant merge commits on first container creation.
  • pr-title-check.yml — new CI workflow that validates PR titles on opened/edited/synchronize using validate-commit-msg --subject-only.
  • PR template Refs: placeholder — added at the end of the PR body template so the merge commit body includes issue traceability.

Changelog Entry

Added

  • Automatic merge commit message compliance (#79)
    • setup-gh-repo.sh configures repo merge settings via gh api (merge_commit_title=PR_TITLE, merge_commit_message=PR_BODY, allow_auto_merge=true)
    • Wired into post-create.sh so downstream devcontainer projects get compliant merge commits automatically
    • --subject-only flag for validate-commit-msg to validate PR titles without requiring body or Refs
    • pr-title-check.yml CI workflow enforces commit message standard on PR titles
    • PR body template includes Refs: # placeholder for merge commit traceability

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

  • 115/115 validate_commit_msg tests pass (12 new TestSubjectOnly tests + 103 existing)
  • bash -n syntax check on setup-gh-repo.sh and post-create.sh
  • YAML syntax validation on pr-title-check.yml

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Post-merge action: Run setup-gh-repo.sh manually against vig-os/devcontainer to apply the merge settings to this repo (since the container won't be recreated just for this change).

Refs: #79

Validates only the subject line (type, scope, description), skipping
body and Refs. Enables PR title validation for merge commit compliance.

Refs: #79
Configures merge_commit_title=PR_TITLE, merge_commit_message=PR_BODY,
and allow_auto_merge=true via gh api. Wired into post-create.sh so
downstream devcontainer projects get compliant merge commits.

Refs: #79
Runs validate-commit-msg --subject-only on pull_request opened/edited/
synchronize to enforce commit message standard on PR titles.

Refs: #79
@gerchowl
gerchowl requested a review from c-vigo as a code owner February 20, 2026 14:33
@gerchowl gerchowl self-assigned this Feb 20, 2026
@gerchowl
gerchowl merged commit 1ca2ce0 into dev Feb 20, 2026
12 checks passed
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.

2 participants