Skip to content

fix(github): accept more app key formats#383

Merged
tlgimenes merged 1 commit intomainfrom
tlgimenes/fix-github-app-key
Apr 15, 2026
Merged

fix(github): accept more app key formats#383
tlgimenes merged 1 commit intomainfrom
tlgimenes/fix-github-app-key

Conversation

@tlgimenes
Copy link
Copy Markdown
Contributor

@tlgimenes tlgimenes commented Apr 15, 2026

This updates the GitHub MCP auth helper to normalize GitHub App private keys before signing JWTs. It now accepts raw PEM values, single-line values with escaped newlines, base64-encoded PEM, and JSON-shaped secrets that contain a nested private key. The change also validates the PEM earlier so startup failures surface as a clear configuration error instead of an OpenSSL NO_START_LINE crash. README and .env example docs now include GITHUB_APP_ID and the supported GITHUB_PRIVATE_KEY formats.


Summary by cubic

Accepts more GitHub App private key formats and validates them early to prevent startup crashes when signing JWTs. Docs now list GITHUB_APP_ID and explain supported GITHUB_PRIVATE_KEY formats.

  • Bug Fixes
    • Normalize GITHUB_PRIVATE_KEY: trims quotes, unescapes \n, reads JSON {privateKey|private_key}, and base64-decodes when needed.
    • Validate the PEM with crypto.createPrivateKey and surface a clear "Invalid GITHUB_PRIVATE_KEY" config error instead of an OpenSSL NO_START_LINE failure.
    • Update README and .env.example with GITHUB_APP_ID and key format guidance.

Written for commit 082f080. Summary will update on new commits.

@tlgimenes tlgimenes merged commit 26ffd2d into main Apr 15, 2026
1 check 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.

1 participant