New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for GitHub repository/organization secrets #1156
base: main
Are you sure you want to change the base?
Conversation
Adds support for organization and repository secrets. As these are part of the Actions API they are put into a new submodule github3.actions. Currently support OrganizationSecrets and RepositorySecrets. more info on the API at https://developer.github.com/v3/actions/secrets
18b1cbe
to
51a7151
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Hey guys and @sigmavirus24, this PR is open for almost a year. I would be really glad if you could spare some time and give me some review feedback on it. |
.. attribute:: updated_at | ||
The timestamp of when the secret was last updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must include documentation for visibility
.
super()._update_attributes(secret) | ||
self.visibility = secret["visibility"] | ||
if self.visibility == "selected": | ||
self._selected_repos_url = secret["selected_repositories_url"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the URL attribute "private"? It should be public and named identically to the value in the JSON.
list_key="repositories", | ||
) | ||
|
||
def set_selected_repositories(self, repository_ids: typing.List[int]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer Sequence
over List
as a List[int]
precludes Tuple[int]
or any other sequence like data that Python will happily correctly serialize to a JSON Array
url = "/".join([self._selected_repos_url, str(repository_id)]) | ||
return self._boolean(self._put(url), 204, 409) | ||
|
||
def delete_selected_repository(self, repository_id: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def delete_selected_repository(self, repository_id: int): | |
def remove_selected_repository(self, repository_id: int): |
Alternatively
These should be:
select_repositories
select_repository
deselect_repository
Adds support for organization and repository secrets. As these are part of the GitHub Actions API they are put into a new submodule
github3.actions
.This PR does not support environment secrets as I believe this would better live in a dedicated Environment module.
This PR would potentially fix issue #1024.