Skip to content

chore(ci): auto-append Signed-off-by via husky prepare-commit-msg#1742

Open
edda wants to merge 1 commit into
mainfrom
edda/husky-auto-signoff
Open

chore(ci): auto-append Signed-off-by via husky prepare-commit-msg#1742
edda wants to merge 1 commit into
mainfrom
edda/husky-auto-signoff

Conversation

@edda
Copy link
Copy Markdown
Contributor

@edda edda commented Jun 5, 2026

Summary

Adds a prepare-commit-msg husky hook that auto-appends a Signed-off-by: trailer using the committer's git identity. DCO checks pass without contributors having to remember -s on every commit.

  • Idempotent: no-op if the trailer is already present (e.g. when -s was used or on rebase --signoff)
  • Skips merge and squash commits, where git generates the message itself
  • No-op if user.name / user.email aren't configured (lets git's own error surface normally)

Test plan

  • Committed this change without -s and verified the trailer was appended automatically (see commit message)
  • Reviewer: clone, make a throwaway commit without -s, confirm trailer is added

Copilot AI review requested due to automatic review settings June 5, 2026 13:55
@edda edda requested a review from a team as a code owner June 5, 2026 13:55
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 5, 2026

⚠️ No Changeset found

Latest commit: d758655

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds a Husky prepare-commit-msg hook to automatically append a Signed-off-by: trailer based on the developer’s local git identity, aiming to make DCO compliance automatic and consistent across commits.

Changes:

  • Introduces .husky/prepare-commit-msg to append a Signed-off-by: trailer via git interpret-trailers.
  • Skips certain commit message sources (currently merge/squash) and no-ops when user.name / user.email are not configured.
  • Avoids re-adding the exact same trailer if already present.

Comment thread .husky/prepare-commit-msg
Comment thread .husky/prepare-commit-msg Outdated
Adds a husky prepare-commit-msg hook that appends a Signed-off-by
trailer using the committer's git identity. DCO checks now pass
without contributors having to remember -s on every commit.

The hook is idempotent (skips if trailer already present) and skips
merge/squash/commit sources where git generates the message itself or
reuses an existing one (e.g. amend, rebase pickup).

Signed-off-by: Esther Schmitz <esther.schmitz@sap.com>
@edda edda force-pushed the edda/husky-auto-signoff branch from 10c5046 to d758655 Compare June 5, 2026 14:12
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