module 2 - collaborator information - #23
Conversation
| options: | ||
| access_token: | ||
| description: | ||
| - GitHub API token used to retrieve information about collaborators in repositories a user has access. |
There was a problem hiding this comment.
'a user has access.' -> 'to which a user has access'
| organization: | ||
| description: | ||
| - The organization whose repository's collaborators will be modified. | ||
| required: true | ||
| type: str | ||
|
|
||
| repository: | ||
| description: | ||
| - The repository whose collaborators will be managed. | ||
| required: true | ||
| type: str |
There was a problem hiding this comment.
Use consistent language. Pick either 'will be managed' or 'will be modified'
| organization: | ||
| description: | ||
| - The organization whose repository's collaborators will be modified. | ||
| required: true | ||
| type: str | ||
|
|
||
| repository: | ||
| description: | ||
| - The repository whose collaborators will be managed. | ||
| required: true | ||
| type: str |
There was a problem hiding this comment.
Use consistent language. Pick either 'will be managed' or 'will be modified'
| collaborators['<ORG NAME>/<REPO NAME>'].<INDEX>: | ||
| description: This index provides access to a dictionary containing information about a single collaborator. | ||
| type: dict | ||
| returned: if at least one collaborator is within repository |
There was a problem hiding this comment.
'within repository' -> 'contained within repository'
| collaborators['<ORG NAME>/<REPO NAME>'].<INDEX>: | ||
| description: This index provides access to a dictionary containing information about a single collaborator. | ||
| type: dict | ||
| returned: if at least one collaborator is within repository |
There was a problem hiding this comment.
'within repository' -> 'contained within repository'
| # changing | ||
| for current_collaborator in output_collaborators: | ||
| if collaborator == current_collaborator['login']: | ||
| current_collaborator['permissions'] = permissions | ||
| if permission == 'admin': | ||
| current_collaborator['site_admin'] = True |
There was a problem hiding this comment.
Can the collaborator_position be used here like it is in the absent_collaborator_check_mode? I'm trying to understand why it was necessary to iterate over output_collaborators?
| output = [] | ||
|
|
||
| if module.params['state'] == 'present': | ||
| if len(module.params['collaborator']) and len(module.params['repository']) and module.params['permission'].lower() in valid_permissions: |
There was a problem hiding this comment.
Check that the inputs are valid before doing any other work.
| output = [] | ||
|
|
||
| if module.params['state'] == 'present': | ||
| if len(module.params['collaborator']) and len(module.params['repository']) and module.params['permission'].lower() in valid_permissions: |
There was a problem hiding this comment.
Check that the inputs are valid before doing any other work.
| else: | ||
| output = absent_collaborator_check_mode( | ||
| g, module.params['repository'], module.params['collaborator'], current_collaborators) | ||
| elif module.params['state'] not in ["absent", "present"]: |
There was a problem hiding this comment.
Validate input parameters before doing any other work.
| else: | ||
| output = absent_collaborator_check_mode( | ||
| g, module.params['repository'], module.params['collaborator'], current_collaborators) | ||
| elif module.params['state'] not in ["absent", "present"]: |
There was a problem hiding this comment.
Validate input parameters before doing any other work.
#2