utils/github/api: fix encoding errors when reading from keychain

This commit is contained in:
Bo Anderson 2024-07-30 04:51:00 +01:00
parent 1b0fdae219
commit a0a3333ee4
No known key found for this signature in database

View File

@ -177,8 +177,9 @@ module GitHub
print_stderr: false
return unless result.success?
github_username = git_credential_out[/username=(.+)/, 1]
github_password = git_credential_out[/password=(.+)/, 1]
git_credential_out.force_encoding("ASCII-8BIT")
github_username = git_credential_out[/^username=(.+)/, 1]
github_password = git_credential_out[/^password=(.+)/, 1]
return unless github_username
# Don't use passwords from the keychain unless they look like