Skip to content

feat(signature): resolve author via Commits API before email search#82

Merged
benner merged 1 commit into
mainfrom
feat/signature-commits-api-lookup
May 2, 2026
Merged

feat(signature): resolve author via Commits API before email search#82
benner merged 1 commit into
mainfrom
feat/signature-commits-api-lookup

Conversation

@benner
Copy link
Copy Markdown
Owner

@benner benner commented May 2, 2026

Corporate developers often commit with work emails that are not listed
publicly on their GitHub profile, causing the email-based user search to
return nothing and fail the signature check.

The Commits API (GET /repos/{owner}/{repo}/commits/{sha}) returns
author.login regardless of the commit email, so it resolves work emails,
noreply addresses, and any email that GitHub associates with an account
through the push. When the repo has a GitHub remote and the commit is
already reachable via the API, this path is tried first.

If the API is unavailable (no GitHub remote, commit not yet pushed,
network error, or 404), the check falls back to the existing email
search so pre-commit and non-GitHub workflows are unaffected.

GITHUB_TOKEN or GH_TOKEN can be set for private repository access.

Corporate developers often commit with work emails that are not listed
publicly on their GitHub profile, causing the email-based user search to
return nothing and fail the signature check.

The Commits API (GET /repos/{owner}/{repo}/commits/{sha}) returns
author.login regardless of the commit email, so it resolves work emails,
noreply addresses, and any email that GitHub associates with an account
through the push. When the repo has a GitHub remote and the commit is
already reachable via the API, this path is tried first.

If the API is unavailable (no GitHub remote, commit not yet pushed,
network error, or 404), the check falls back to the existing email
search so pre-commit and non-GitHub workflows are unaffected.

GITHUB_TOKEN or GH_TOKEN can be set for private repository access.

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Coverage

Coverage Report (Δ +0.0%)
FileStmtsMissCoverMissing
src/git_commit_guard
   __init__.py4600100% 
TOTAL4600100% 

@benner benner marked this pull request as ready for review May 2, 2026 05:26
@benner benner merged commit 5cc32ae into main May 2, 2026
7 checks passed
@benner benner deleted the feat/signature-commits-api-lookup branch May 2, 2026 05:26
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.

1 participant