Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions cli/githubUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,28 @@ export async function addGitHubKey(
// Generate key name
const keyName = customName || `github:${sanitizedUsername}`;

// Map the PGP key info to GitHub key format
// importPgpKey returns keyId, but we use it as fingerprint for GitHub keys
const githubKeyInfo = {
fingerprint: keyInfo.keyId,
email: keyInfo.email ?? undefined
};
Comment on lines +174 to +177

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states 'importPgpKey returns keyId, not fingerprint' but the mapping uses keyId as fingerprint for GitHub keys. This needs clarification—either the comment should explain why keyId is semantically equivalent to fingerprint for GitHub keys, or document if this is a workaround for a limitation in the PGP import.

Copilot uses AI. Check for mistakes.

// Add to key manager
await addGitHubKeyToManager(keyName, sanitizedUsername, keyInfo, gpgKeyData);
await addGitHubKeyToManager(keyName, sanitizedUsername, githubKeyInfo, gpgKeyData);

if (!silent) {
console.log(`✓ GitHub key added: ${keyName}`);
console.log(` Fingerprint: ${keyInfo.fingerprint}`);
if (keyInfo.email) {
console.log(` Email: ${keyInfo.email}`);
console.log(` Fingerprint: ${githubKeyInfo.fingerprint}`);
if (githubKeyInfo.email) {
console.log(` Email: ${githubKeyInfo.email}`);
}
}

return {
name: keyName,
fingerprint: keyInfo.fingerprint,
email: keyInfo.email
fingerprint: githubKeyInfo.fingerprint,
email: githubKeyInfo.email
};
}

Expand Down
2 changes: 2 additions & 0 deletions cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ interface KeysOptions {
nativePgp?: boolean;
keybase?: string;
keybaseName?: string;
github?: string;
githubName?: string;
verify?: boolean;
verbose?: boolean;
debug?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion cli/unifiedKeyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface ExecResult {
}

export interface ImportOptions {
source: 'file' | 'pgp-server' | 'keybase' | 'gpg-import' | 'gpg-keyring';
source: 'file' | 'pgp-server' | 'keybase' | 'github' | 'gpg-import' | 'gpg-keyring';
content?: string;
name?: string;
file?: string;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.