#3569·PyGithub

Add support for commit signature

Author: j-flatCreated Sep 1, 2026Updated Sep 1, 2026

Problem

POST /repos/{owner}/{repo}/git/commits accepts an optional signature field, which Github stores in the gpgsig header of the commit it creates and uses to verify it. Repository.create_git_commit did not expose that field, so commits created through PyGithub could not be signed and were always reported as unverified.

GitHub Doc reference commits#create-a-commit

Proposed change

Add an optional argument signature: Opt[str] to Repository.create_git_commit, handled the same way as the existing author and committer arguments: validated with is_optional and only added to the post parameters when defined. The argument should come last, so existing callers are unaffected.