From 1da84df22f58bf51bcb89bf8bc0adb49aaaf7b16 Mon Sep 17 00:00:00 2001 From: Hongxin Liang Date: Wed, 1 Apr 2026 14:19:43 +0200 Subject: [PATCH] fix: add sign-off to release commits for DCO check The maven-release-plugin creates version bump commits on master, which fail the DCO required status check. Add a prepare-commit-msg git hook in the release workflow to automatically append Signed-off-by trailer. Signed-off-by: Hongxin Liang Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Hongxin Liang --- .github/workflows/release.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cd653463..6d07bdf9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,6 +41,13 @@ jobs: git config --global user.email ${{ github.actor }}@users.noreply.github.com git config --global user.name ${{ github.actor }} + - name: Enable automatic sign-off for DCO + run: | + mkdir -p "$HOME/.config/git/hooks" + printf '#!/bin/bash\nif ! grep -q "^Signed-off-by:" "$1"; then\n git interpret-trailers --in-place --trailer "Signed-off-by: $(git config user.name) <$(git config user.email)>" "$1"\nfi\n' > "$HOME/.config/git/hooks/prepare-commit-msg" + chmod +x "$HOME/.config/git/hooks/prepare-commit-msg" + git config --global core.hooksPath "$HOME/.config/git/hooks" + - name: Publish to MavenCentral run: | export GPG_TTY=$(tty)