python-github3
python-github3 copied to clipboard
Add `read_only` parameter to Key schema
What's this PR do?
The GitHub API create Key method also takes in a read_only parameter to set keys to read-only. This PR adds the field to the schema so it can be properly passed through.
https://developer.github.com/v3/repos/keys/#create
Previously, this would create new keys with "read/write" access, which GitHub sets by default. Now, this matches their API parameters and allows the keys to be set as read-only. If the read_only field is omitted, it will default to "read/write".
Usage:
key_params = {
'title': 'Title of your key',
'key': <public_key>,
'read-only': True,
}