Add Secret and Variable classes (#2623)

Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
Mauricio Alejandro Martínez Pacheco
2023-08-10 10:06:44 +02:00
committed by GitHub
co-authored by Enrico Minack
parent 7cfa476187
commit bcca758d13
19 changed files with 865 additions and 157 deletions
+87 -71
View File
@@ -48,6 +48,8 @@ from typing import Any
import github.Event
import github.GithubObject
import github.NamedUser
import github.OrganizationSecret
import github.OrganizationVariable
import github.PaginatedList
import github.Plan
import github.Project
@@ -618,12 +620,12 @@ class Organization(github.GithubObject.CompletableGithubObject):
selected_repositories: github.GithubObject.Opt[list[github.Repository.Repository]] = github.GithubObject.NotSet,
):
"""
:calls: `PUT /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret>`_
:calls: `PUT /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret>`_
:param secret_name: string
:param unencrypted_value: string
:param visibility: string
:param selected_repositories: Optional list of :class:`github.Repository.Repository`
:rtype: bool
:rtype: github.OrganizationSecret.OrganizationSecret
"""
assert isinstance(secret_name, str), secret_name
assert isinstance(unencrypted_value, str), unencrypted_value
@@ -645,10 +647,46 @@ class Organization(github.GithubObject.CompletableGithubObject):
if selected_repositories is not github.GithubObject.NotSet:
put_parameters["selected_repository_ids"] = [element.id for element in selected_repositories]
status, headers, data = self._requester.requestJson(
"PUT", f"{self.url}/actions/secrets/{secret_name}", input=put_parameters
self._requester.requestJsonAndCheck("PUT", f"{self.url}/actions/secrets/{secret_name}", input=put_parameters)
return github.OrganizationSecret.OrganizationSecret(
requester=self._requester,
headers={},
attributes={
"name": secret_name,
"visibility": visibility,
"selected_repositories_url": f"{self.url}/actions/secrets/{secret_name}/repositories",
"url": f"{self.url}/actions/secrets/{secret_name}",
},
completed=False,
)
def get_secrets(self):
"""
Gets all organization secrets
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.OrganizationSecret.OrganizationSecret`
"""
return github.PaginatedList.PaginatedList(
github.OrganizationSecret.OrganizationSecret,
self._requester,
f"{self.url}/actions/secrets",
None,
list_item="secrets",
)
def get_secret(self, secret_name: str):
"""
:calls: 'GET /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret>`_
:param secret_name: string
:rtype: github.OrganizationSecret.OrganizationSecret
"""
assert isinstance(secret_name, str), secret_name
return github.OrganizationSecret.OrganizationSecret(
requester=self._requester,
headers={},
attributes={"url": f"{self.url}/actions/secrets/{secret_name}"},
completed=False,
)
return status == 201
def create_team(
self,
@@ -694,14 +732,14 @@ class Organization(github.GithubObject.CompletableGithubObject):
value: str,
visibility: str = "all",
selected_repositories: github.GithubObject.Opt[list[github.Repository.Repository]] = github.GithubObject.NotSet,
) -> bool:
) -> github.OrganizationVariable.OrganizationVariable:
"""
:calls: `PUT /orgs/{org}/actions/variables/ <https://docs.github.com/en/rest/reference/actions/variables#create-an-organization-variable>`_
:calls: `POST /orgs/{org}/actions/variables/ <https://docs.github.com/en/rest/actions/variables#create-an-organization-variable>`_
:param variable_name: string
:param value: string
:param visibility: string
:param selected_repositories: list of :class:`github.Repository.Repository`
:rtype: bool
:rtype: github.OrganizationVariable.OrganizationVariable
"""
assert isinstance(variable_name, str), variable_name
assert isinstance(value, str), value
@@ -720,10 +758,48 @@ class Organization(github.GithubObject.CompletableGithubObject):
}
if selected_repositories is not github.GithubObject.NotSet:
post_parameters["selected_repository_ids"] = [element.id for element in selected_repositories]
status, headers, data = self._requester.requestJson(
"POST", f"{self.url}/actions/variables", input=post_parameters
self._requester.requestJsonAndCheck("POST", f"{self.url}/actions/variables", input=post_parameters)
return github.OrganizationVariable.OrganizationVariable(
requester=self._requester,
headers={},
attributes={
"name": variable_name,
"visibility": visibility,
"value": value,
"selected_repositories_url": f"{self.url}/actions/variables/{variable_name}/repositories",
"url": self.url,
},
completed=False,
)
def get_variables(self):
"""
Gets all organization variables
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.OrganizationVariable.OrganizationVariable`
"""
return github.PaginatedList.PaginatedList(
github.OrganizationVariable.OrganizationVariable,
self._requester,
f"{self.url}/actions/variables",
None,
list_item="variables",
)
def get_variable(self, variable_name: str):
"""
:calls: 'GET /orgs/{org}/actions/variables/{variable_name} <https://docs.github.com/en/rest/actions/variables#get-an-organization-variable>`_
:param variable_name: string
:rtype: github.OrganizationVariable.OrganizationVariable
"""
assert isinstance(variable_name, str), variable_name
return github.OrganizationVariable.OrganizationVariable(
requester=self._requester,
headers={},
attributes={"url": f"{self.url}/actions/variables/{variable_name}"},
completed=False,
)
return status == 201
def delete_hook(self, id):
"""
@@ -734,26 +810,6 @@ class Organization(github.GithubObject.CompletableGithubObject):
assert isinstance(id, int), id
headers, data = self._requester.requestJsonAndCheck("DELETE", f"{self.url}/hooks/{id}")
def delete_secret(self, secret_name):
"""
:calls: `DELETE /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret>`_
:param secret_name: string
:rtype: bool
"""
assert isinstance(secret_name, str), secret_name
status, headers, data = self._requester.requestJson("DELETE", f"{self.url}/actions/secrets/{secret_name}")
return status == 204
def delete_variable(self, variable_name: str) -> bool:
"""
:calls: `DELETE /orgs/{org}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions/variables#delete-an-organization-variable>`_
:param variable_name: string
:rtype: bool
"""
assert isinstance(variable_name, str), variable_name
status, headers, data = self._requester.requestJson("DELETE", f"{self.url}/actions/variables/{variable_name}")
return status == 204
def edit(
self,
billing_email=github.GithubObject.NotSet,
@@ -833,46 +889,6 @@ class Organization(github.GithubObject.CompletableGithubObject):
headers, data = self._requester.requestJsonAndCheck("PATCH", f"{self.url}/hooks/{id}", input=post_parameters)
return github.Hook.Hook(self._requester, headers, data, completed=True)
def update_variable(
self,
variable_name: str,
value: str,
visibility: str = "all",
selected_repositories: github.GithubObject.Opt[list[github.Repository.Repository]] = github.GithubObject.NotSet,
) -> bool:
"""
:calls: `PATCH /orgs/{org}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions/variables#update-an-organization-variable>`_
:param variable_name: string
:param value: string
:param visibility: string
:param selected_repositories: Optional list of :class:`github.Repository.Repository`
:rtype: bool
"""
assert isinstance(variable_name, str), variable_name
assert isinstance(value, str), value
assert isinstance(visibility, str), visibility
if visibility == "selected":
assert isinstance(selected_repositories, list) and all(
isinstance(element, github.Repository.Repository) for element in selected_repositories
), selected_repositories
else:
assert selected_repositories is github.GithubObject.NotSet
patch_parameters = {
"name": variable_name,
"value": value,
"visibility": visibility,
}
if selected_repositories is not github.GithubObject.NotSet:
patch_parameters["selected_repository_ids"] = [element.id for element in selected_repositories]
status, headers, data = self._requester.requestJson(
"PATCH",
f"{self.url}/actions/variables/{variable_name}",
input=patch_parameters,
)
return status == 204
def get_events(self):
"""
:calls: `GET /orgs/{org}/events <https://docs.github.com/en/rest/reference/activity#events>`_
+18 -11
View File
@@ -9,6 +9,8 @@ from github.Issue import Issue
from github.Label import Label
from github.Migration import Migration
from github.NamedUser import NamedUser
from github.OrganizationSecret import OrganizationSecret
from github.OrganizationVariable import OrganizationVariable
from github.PaginatedList import PaginatedList
from github.Plan import Plan
from github.Project import Project
@@ -70,13 +72,20 @@ class Organization(CompletableGithubObject):
allow_merge_commit: Union[bool, _NotSetType] = ...,
allow_rebase_merge: Union[bool, _NotSetType] = ...,
) -> Repository: ...
def get_secrets(
self,
) -> PaginatedList[OrganizationSecret]: ...
def get_secret(
self,
secret_name: str,
) -> OrganizationSecret: ...
def create_secret(
self,
secret_name: str,
unencrypted_value: str,
visibility: str = ...,
selected_repositories: Union[List[Repository], _NotSetType] = ...,
) -> bool: ...
) -> OrganizationSecret: ...
def create_team(
self,
name: str,
@@ -85,24 +94,29 @@ class Organization(CompletableGithubObject):
privacy: Union[str, _NotSetType] = ...,
description: Union[str, _NotSetType] = ...,
) -> Team: ...
def get_variables(
self,
) -> PaginatedList[OrganizationVariable]: ...
def get_variable(
self,
variable_name: str,
) -> OrganizationVariable: ...
def create_variable(
self,
variable_name: str,
value: str,
visibility: str = ...,
selected_repositories: Union[List[Repository], _NotSetType] = ...,
) -> bool: ...
) -> OrganizationVariable: ...
@property
def created_at(self) -> datetime: ...
def delete_hook(self, id: int) -> None: ...
@property
def default_repository_permission(self) -> str: ...
def delete_secret(self, secret_name: str) -> bool: ...
@property
def description(self) -> str: ...
@property
def disk_usage(self) -> int: ...
def delete_variable(self, variable_name: str) -> bool: ...
def edit(
self,
billing_email: Union[str, _NotSetType] = ...,
@@ -121,13 +135,6 @@ class Organization(CompletableGithubObject):
events: Union[_NotSetType, List[str]] = ...,
active: Union[bool, _NotSetType] = ...,
) -> Hook: ...
def update_variable(
self,
variable_name: str,
value: str,
visibility: str = ...,
selected_repositories: Union[List[Repository], _NotSetType] = ...,
) -> bool: ...
@property
def email(self) -> Optional[str]: ...
@property
+126
View File
@@ -0,0 +1,126 @@
############################ Copyrights and license ############################
# #
# Copyright 2023 Mauricio Martinez <mauricio.martinez@premise.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from datetime import datetime
from typing import Any, Dict
from github.GithubObject import Attribute, NotSet
from github.PaginatedList import PaginatedList
from github.Repository import Repository
from github.Secret import Secret
class OrganizationSecret(Secret):
"""
This class represents a org level GitHub secret. The reference can be found here https://docs.github.com/en/rest/actions/secrets
"""
def _initAttributes(self) -> None:
self._name: Attribute[str] = NotSet
self._created_at: Attribute[datetime] = NotSet
self._updated_at: Attribute[datetime] = NotSet
self._visibility: Attribute[str] = NotSet
self._selected_repositories: Attribute[PaginatedList[Repository]] = NotSet
self._selected_repositories_url: Attribute[str] = NotSet
self._url: Attribute[str] = NotSet
@property
def visibility(self) -> str:
"""
:type: string
"""
self._completeIfNotSet(self._visibility)
return self._visibility.value
@property
def selected_repositories(self) -> PaginatedList[Repository]:
return PaginatedList(
Repository,
self._requester,
self._selected_repositories_url.value,
None,
list_item="repositories",
)
def edit(
self,
value: str,
visibility: str = "all",
) -> bool:
"""
:calls: `PATCH /orgs/{org}/actions/secrets/{variable_name} <https://docs.github.com/en/rest/reference/actions/secrets#update-an-organization-variable>`_
:param variable_name: string
:param value: string
:param visibility: string
:rtype: bool
"""
assert isinstance(value, str), value
assert isinstance(visibility, str), visibility
patch_parameters: Dict[str, Any] = {
"name": self.name,
"value": value,
"visibility": visibility,
}
status, _, _ = self._requester.requestJson(
"PATCH",
f"{self.url}/actions/secrets/{self.name}",
input=patch_parameters,
)
return status == 204
def add_repo(self, repo: Repository) -> bool:
"""
:calls: 'PUT {org_url}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret>`_
:param repo: github.Repository.Repository
:rtype: bool
"""
if self.visibility != "selected":
return False
self._requester.requestJsonAndCheck("PUT", f"{self._selected_repositories_url.value}/{repo.id}")
return True
def remove_repo(self, repo: Repository) -> bool:
"""
:calls: 'DELETE {org_url}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret>`_
:param repo: github.Repository.Repository
:rtype: bool
"""
if self.visibility != "selected":
return False
self._requester.requestJsonAndCheck("DELETE", f"{self._selected_repositories_url.value}/{repo.id}")
return True
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "name" in attributes:
self._name = self._makeStringAttribute(attributes["name"])
if "created_at" in attributes:
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "updated_at" in attributes:
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "visibility" in attributes:
self._visibility = self._makeStringAttribute(attributes["visibility"])
if "selected_repositories_url" in attributes:
self._selected_repositories_url = self._makeStringAttribute(attributes["selected_repositories_url"])
if "url" in attributes:
self._url = self._makeStringAttribute(attributes["url"])
+126
View File
@@ -0,0 +1,126 @@
############################ Copyrights and license ############################
# #
# Copyright 2023 Mauricio Martinez <mauricio.martinez@premise.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from datetime import datetime
from typing import Any, Dict
from github.GithubObject import Attribute, NotSet
from github.PaginatedList import PaginatedList
from github.Repository import Repository
from github.Variable import Variable
class OrganizationVariable(Variable):
"""
This class represents a org level GitHub variable. The reference can be found here https://docs.github.com/en/rest/actions/variables
"""
def _initAttributes(self) -> None:
self._name: Attribute[str] = NotSet
self._created_at: Attribute[datetime] = NotSet
self._updated_at: Attribute[datetime] = NotSet
self._visibility: Attribute[str] = NotSet
self._selected_repositories: Attribute[PaginatedList[Repository]] = NotSet
self._selected_repositories_url: Attribute[str] = NotSet
self._url: Attribute[str] = NotSet
@property
def visibility(self) -> str:
"""
:type: string
"""
self._completeIfNotSet(self._visibility)
return self._visibility.value
@property
def selected_repositories(self) -> PaginatedList[Repository]:
return PaginatedList(
Repository,
self._requester,
self._selected_repositories_url.value,
None,
list_item="repositories",
)
def edit(
self,
value: str,
visibility: str = "all",
) -> bool:
"""
:calls: `PATCH /orgs/{org}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions/variables#update-an-organization-variable>`_
:param variable_name: string
:param value: string
:param visibility: string
:rtype: bool
"""
assert isinstance(value, str), value
assert isinstance(visibility, str), visibility
patch_parameters: Dict[str, Any] = {
"name": self.name,
"value": value,
"visibility": visibility,
}
status, _, _ = self._requester.requestJson(
"PATCH",
f"{self.url}/actions/variables/{self.name}",
input=patch_parameters,
)
return status == 204
def add_repo(self, repo: Repository) -> bool:
"""
:calls: 'PUT {org_url}/actions/variables/{variable_name} <https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-secret>`_
:param repo: github.Repository.Repository
:rtype: bool
"""
if self.visibility != "selected":
return False
self._requester.requestJsonAndCheck("PUT", f"{self._selected_repositories_url.value}/{repo.id}")
return True
def remove_repo(self, repo: Repository) -> bool:
"""
:calls: 'DELETE {org_url}/actions/variables/{variable_name} <https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-secret>`_
:param repo: github.Repository.Repository
:rtype: bool
"""
if self.visibility != "selected":
return False
self._requester.requestJsonAndCheck("DELETE", f"{self._selected_repositories_url.value}/{repo.id}")
return True
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "name" in attributes:
self._name = self._makeStringAttribute(attributes["name"])
if "created_at" in attributes:
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "updated_at" in attributes:
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "visibility" in attributes:
self._visibility = self._makeStringAttribute(attributes["visibility"])
if "selected_repositories_url" in attributes:
self._selected_repositories_url = self._makeStringAttribute(attributes["selected_repositories_url"])
if "url" in attributes:
self._url = self._makeStringAttribute(attributes["url"])
+71 -44
View File
@@ -1565,7 +1565,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
def create_repository_dispatch(self, event_type, client_payload=github.GithubObject.NotSet):
"""
:calls: POST /repos/{owner}/{repo}/dispatches <https://docs.github.com/en/rest/reference/repos#create-a-repository-dispatch-event>
:calls: POST /repos/{owner}/{repo}/dispatches <https://docs.github.com/en/rest/repos#create-a-repository-dispatch-event>
:param event_type: string
:param client_payload: dict
:rtype: bool
@@ -1580,10 +1580,10 @@ class Repository(github.GithubObject.CompletableGithubObject):
def create_secret(self, secret_name, unencrypted_value):
"""
:calls: `PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/reference/actions#get-a-repository-secret>`_
:calls: `PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#get-a-repository-secret>`_
:param secret_name: string
:param unencrypted_value: string
:rtype: bool
:rtype: github.Secret.Secret
"""
assert isinstance(secret_name, str), secret_name
assert isinstance(unencrypted_value, str), unencrypted_value
@@ -1593,14 +1593,47 @@ class Repository(github.GithubObject.CompletableGithubObject):
"key_id": public_key.key_id,
"encrypted_value": payload,
}
status, headers, data = self._requester.requestJson(
"PUT", f"{self.url}/actions/secrets/{secret_name}", input=put_parameters
self._requester.requestJsonAndCheck("PUT", f"{self.url}/actions/secrets/{secret_name}", input=put_parameters)
return github.Secret.Secret(
requester=self._requester,
headers={},
attributes={
"name": secret_name,
"url": f"{self.url}/actions/secrets/{secret_name}",
},
completed=False,
)
def get_secrets(self):
"""
Gets all repository secrets
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Secret.Secret`
"""
return github.PaginatedList.PaginatedList(
github.Secret.Secret,
self._requester,
f"{self.url}/actions/secrets",
None,
list_item="secrets",
)
def get_secret(self, secret_name: str):
"""
:calls: 'GET /repos/{owner}/{repo}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret>`_
:param secret_name: string
:rtype: github.Secret.Secret
"""
assert isinstance(secret_name, str), secret_name
return github.Secret.Secret(
requester=self._requester,
headers={},
attributes={"url": f"{self.url}/actions/secrets/{secret_name}"},
completed=False,
)
return status == 201
def create_variable(self, variable_name: str, value: str) -> bool:
"""
:calls: `POST /repos/{owner}/{repo}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions/variables#create-a-repository-variable>`_
:calls: `POST /repos/{owner}/{repo}/actions/variables/{variable_name} <https://docs.github.com/en/rest/actions/variables#create-a-repository-variable>`_
:param variable_name: string
:param value: string
:rtype: bool
@@ -1611,50 +1644,44 @@ class Repository(github.GithubObject.CompletableGithubObject):
"name": variable_name,
"value": value,
}
status, headers, data = self._requester.requestJson(
"POST", f"{self.url}/actions/variables", input=post_parameters
self._requester.requestJsonAndCheck("POST", f"{self.url}/actions/variables", input=post_parameters)
return github.Variable.Variable(
self._requester,
headers={},
attributes={
"name": variable_name,
"value": value,
"url": self.url,
},
completed=False,
)
return status == 201
def update_variable(self, variable_name: str, value: str) -> bool:
def get_variables(self):
"""
:calls: `PATCH /repos/{owner}/{repo}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions/variables#update-a-repository-variable>`_
Gets all repository variables
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Variable.Variable`
"""
return github.PaginatedList.PaginatedList(
github.Variable.Variable,
self._requester,
f"{self.url}/actions/variables",
None,
list_item="variables",
)
def get_variable(self, variable_name: str):
"""
:calls: 'GET /orgs/{org}/actions/variables/{variable_name} <https://docs.github.com/en/rest/actions/variables#get-an-organization-variable>`_
:param variable_name: string
:param value: string
:rtype: bool
:rtype: github.Variable.Variable
"""
assert isinstance(variable_name, str), variable_name
assert isinstance(value, str), value
patch_parameters = {
"name": variable_name,
"value": value,
}
status, headers, data = self._requester.requestJson(
"PATCH",
f"{self.url}/actions/variables/{variable_name}",
input=patch_parameters,
return github.Variable.Variable(
requester=self._requester,
headers={},
attributes={"url": f"{self.url}/actions/variables/{variable_name}"},
completed=False,
)
return status == 204
def delete_secret(self, secret_name):
"""
:calls: `DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/reference/actions#delete-a-repository-secret>`_
:param secret_name: string
:rtype: bool
"""
assert isinstance(secret_name, str), secret_name
status, headers, data = self._requester.requestJson("DELETE", f"{self.url}/actions/secrets/{secret_name}")
return status == 204
def delete_variable(self, variable_name: str) -> bool:
"""
:calls: `DELETE /repos/{owner}/{repo}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions#delete-a-repository-variable>`_
:param variable_name: string
:rtype: bool
"""
assert isinstance(variable_name, str), variable_name
status, headers, data = self._requester.requestJson("DELETE", f"{self.url}/actions/variables/{variable_name}")
return status == 204
def create_source_import(
self,
+8 -3
View File
@@ -57,6 +57,7 @@ from github.RepositoryAdvisoryVulnerability import (
)
from github.RepositoryKey import RepositoryKey
from github.RepositoryPreferences import RepositoryPreferences
from github.Secret import Secret
from github.SelfHostedActionsRunner import SelfHostedActionsRunner
from github.SourceImport import SourceImport
from github.Stargazer import Stargazer
@@ -67,6 +68,7 @@ from github.StatsParticipation import StatsParticipation
from github.StatsPunchCard import StatsPunchCard
from github.Tag import Tag
from github.Team import Team
from github.Variable import Variable
from github.View import View
from github.Workflow import Workflow
from github.WorkflowRun import WorkflowRun
@@ -282,9 +284,12 @@ class Repository(CompletableGithubObject):
def create_repository_dispatch(
self, event_type: str, client_payload: Union[Dict[str, Any], _NotSetType] = ...
) -> bool: ...
def create_secret(self, secret_name: str, unencrypted_value: str) -> bool: ...
def create_variable(self, variable_name: str, value: str) -> bool: ...
def update_variable(self, variable_name: str, value: str) -> bool: ...
def get_secrets(self) -> PaginatedList[Secret]: ...
def get_secret(self, secret_name: str) -> Secret: ...
def create_secret(self, secret_name: str, unencrypted_value: str) -> Secret: ...
def get_variables(self) -> PaginatedList[Variable]: ...
def get_variable(self, variable_name: str) -> Variable: ...
def create_variable(self, variable_name: str, value: str) -> Variable: ...
def delete_secret(self, secret_name: str) -> bool: ...
def delete_variable(self, variable_name: str) -> bool: ...
def create_source_import(
+89
View File
@@ -0,0 +1,89 @@
############################ Copyrights and license ############################
# #
# Copyright 2023 Mauricio Martinez <mauricio.martinez@premise.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from datetime import datetime
from typing import Any, Dict
from github.GithubObject import Attribute, CompletableGithubObject, NotSet
class Secret(CompletableGithubObject):
"""
This class represents a GitHub secret. The reference can be found here https://docs.github.com/en/rest/actions/secrets
"""
def _initAttributes(self) -> None:
self._name: Attribute[str] = NotSet
self._created_at: Attribute[datetime] = NotSet
self._updated_at: Attribute[datetime] = NotSet
self._url: Attribute[str] = NotSet
def __repr__(self) -> str:
return self.get__repr__({"name": self.name})
@property
def name(self) -> str:
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def created_at(self) -> datetime:
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def updated_at(self) -> datetime:
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self) -> str:
"""
:type: string
"""
return self._url.value
def delete(self) -> None:
"""
:calls: `DELETE {secret_url} <https://docs.github.com/en/rest/actions/secrets>`_
:rtype: None
"""
self._requester.requestJsonAndCheck("DELETE", self.url)
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "name" in attributes:
self._name = self._makeStringAttribute(attributes["name"])
if "created_at" in attributes:
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "updated_at" in attributes:
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes:
self._url = self._makeStringAttribute(attributes["url"])
+121
View File
@@ -0,0 +1,121 @@
############################ Copyrights and license ############################
# #
# Copyright 2023 Mauricio Martinez <mauricio.martinez@premise.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from __future__ import annotations
from datetime import datetime
from typing import Any
from github.GithubObject import Attribute, CompletableGithubObject, NotSet
class Variable(CompletableGithubObject):
"""
This class represents a GitHub variable. The reference can be found here https://docs.github.com/en/rest/actions/variables
"""
def _initAttributes(self) -> None:
self._name: Attribute[str] = NotSet
self._value: Attribute[str] = NotSet
self._created_at: Attribute[datetime] = NotSet
self._updated_at: Attribute[datetime] = NotSet
self._url: Attribute[str] = NotSet
def __repr__(self) -> str:
return self.get__repr__({"name": self.name})
@property
def name(self) -> str:
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def value(self) -> str:
"""
:type: string
"""
self._completeIfNotSet(self._value)
return self._value.value
@property
def created_at(self) -> datetime:
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def updated_at(self) -> datetime:
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self) -> str:
"""
:type: string
"""
return self._url.value
def edit(self, value: str) -> bool:
"""
:calls: `PATCH /repos/{owner}/{repo}/actions/variables/{variable_name} <https://docs.github.com/en/rest/reference/actions/variables#update-a-repository-variable>`_
:param variable_name: string
:param value: string
:rtype: bool
"""
assert isinstance(value, str), value
patch_parameters = {
"name": self.name,
"value": value,
}
status, _, _ = self._requester.requestJson(
"PATCH",
f"{self.url}/actions/variables/{self.name}",
input=patch_parameters,
)
return status == 204
def delete(self) -> None:
"""
:calls: `DELETE {variable_url} <https://docs.github.com/en/rest/actions/variables>`_
:rtype: None
"""
self._requester.requestJsonAndCheck("DELETE", f"{self.url}/actions/variables/{self.name}")
def _useAttributes(self, attributes: dict[str, Any]) -> None:
if "name" in attributes:
self._name = self._makeStringAttribute(attributes["name"])
if "value" in attributes:
self._value = self._makeStringAttribute(attributes["value"])
if "created_at" in attributes:
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "updated_at" in attributes:
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes:
self._url = self._makeStringAttribute(attributes["url"])
+43 -10
View File
@@ -399,17 +399,32 @@ class Organization(Framework.TestCase):
def testCreateSecret(self, encrypt):
# encrypt returns a non-deterministic value, we need to mock it so the replay data matches
encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"
self.assertTrue(self.org.create_secret("secret-name", "secret-value", "all"))
secret = self.org.create_secret("secret-name", "secret-value", "all")
self.assertIsNotNone(secret)
@mock.patch("github.PublicKey.encrypt")
def testCreateSecretSelected(self, encrypt):
# encrypt returns a non-deterministic value, we need to mock it so the replay data matches
repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")]
# encrypt returns a non-deterministic value, we need to mock it so the replay data matches
encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"
self.assertTrue(self.org.create_secret("secret-name", "secret-value", "selected", repos))
secret = self.org.create_secret("secret-name", "secret-value", "selected", repos)
self.assertIsNotNone(secret)
self.assertEqual(secret.visibility, "selected")
self.assertEqual(list(secret.selected_repositories), repos)
def testDeleteSecret(self):
self.assertTrue(self.org.delete_secret("secret-name"))
def testGetSecret(self):
repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")]
secret = self.org.get_secret("secret-name")
self.assertEqual(secret.name, "secret-name")
self.assertEqual(secret.created_at, datetime(2019, 8, 10, 14, 59, 22, tzinfo=timezone.utc))
self.assertEqual(secret.updated_at, datetime(2020, 1, 10, 14, 59, 22, tzinfo=timezone.utc))
self.assertEqual(secret.visibility, "selected")
self.assertEqual(list(secret.selected_repositories), repos)
self.assertEqual(secret.url, "https://api.github.com/orgs/BeaverSoftware/actions/secrets/secret-name")
def testGetSecrets(self):
secrets = self.org.get_secrets()
self.assertEqual(len(list(secrets)), 1)
def testInviteUserWithNeither(self):
with self.assertRaises(AssertionError) as raisedexp:
@@ -461,8 +476,26 @@ class Organization(Framework.TestCase):
self.assertEqual(installations[0].target_type, "User")
self.assertEqual(installations.totalCount, 1)
def testOrgVariable(self):
self.org = self.g.get_organization("tecnoly")
self.assertTrue(self.org.create_variable("variable_name", "variable-value"))
self.assertTrue(self.org.update_variable("variable_name", "variable-value123"))
self.assertTrue(self.org.delete_variable("variable_name"))
def testCreateVariable(self):
variable = self.org.create_variable("variable-name", "variable-value", "all")
self.assertIsNotNone(variable)
def testCreateVariableSelected(self):
repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")]
variable = self.org.create_variable("variable-name", "variable-value", "selected", repos)
self.assertIsNotNone(variable)
self.assertEqual(list(variable.selected_repositories), repos)
def testGetVariable(self):
repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")]
variable = self.org.get_variable("variable-name")
self.assertEqual(variable.name, "variable-name")
self.assertEqual(variable.created_at, datetime(2019, 8, 10, 14, 59, 22, tzinfo=timezone.utc))
self.assertEqual(variable.updated_at, datetime(2020, 1, 10, 14, 59, 22, tzinfo=timezone.utc))
self.assertEqual(variable.visibility, "selected")
self.assertEqual(list(variable.selected_repositories), repos)
self.assertEqual(variable.url, "https://api.github.com/orgs/BeaverSoftware/actions/variables/variable-name")
def testGetVariables(self):
variables = self.org.get_variables()
self.assertEqual(len(list(variables)), 1)
@@ -18,4 +18,4 @@ None
{"encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "key_id": "568250167242549743", "visibility": "all"}
201
[('Date', 'Fri, 17 Apr 2020 00:12:33 GMT'), ('Server', 'GitHub.com'), ('Content-Length', '2'), ('Content-Type', 'application/json; charset=utf-8'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4984'), ('X-RateLimit-Reset', '1587085388'), ('X-OAuth-Scopes', 'read:org, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Vary', 'Accept-Encoding, Accept, X-Requested-With'), ('X-GitHub-Request-Id', 'C290:52DA:50234:B404B:5E98F470')]
{}
{}
@@ -41,3 +41,14 @@ None
201
[('Date', 'Fri, 17 Apr 2020 00:12:33 GMT'), ('Server', 'GitHub.com'), ('Content-Length', '2'), ('Content-Type', 'application/json; charset=utf-8'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4984'), ('X-RateLimit-Reset', '1587085388'), ('X-OAuth-Scopes', 'read:org, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Vary', 'Accept-Encoding, Accept, X-Requested-With'), ('X-GitHub-Request-Id', 'C290:52DA:50234:B404B:5E98F470')]
{}
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/secrets/secret-name/repositories
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"total_count": 2, "repositories": [{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}, {"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}]}
@@ -0,0 +1,10 @@
https
POST
api.github.com
None
/orgs/BeaverSoftware/actions/variables
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"name": "variable-name", "value": "variable-value", "visibility": "all"}
201
[('Server', 'GitHub.com'), ('Date', 'Wed, 28 Jun 2023 19:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '2'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', '"ab9b40dea6722e415dd424b31be226eac6da76ca693e83c73fed865610a4937e"'), ('X-OAuth-Scopes', 'admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2023-07-05 17:42:21 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4905'), ('X-RateLimit-Reset', '1687981543'), ('X-RateLimit-Used', '95'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', '6FD1:95BE:1234AD:24C286:649C87BD')]
{}
@@ -0,0 +1,43 @@
https
GET
api.github.com
None
/repos/BeaverSoftware/TestPyGithub
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Accept': 'application/vnd.github.nebula-preview+json'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}
https
GET
api.github.com
None
/repos/BeaverSoftware/FatherBeaver
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Accept': 'application/vnd.github.nebula-preview+json'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}
https
POST
api.github.com
None
/orgs/BeaverSoftware/actions/variables
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"name": "variable-name", "value": "variable-value", "visibility": "selected", "selected_repository_ids": [3609352, 3400397]}
201
[('Server', 'GitHub.com'), ('Date', 'Wed, 28 Jun 2023 19:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '2'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', '"ab9b40dea6722e415dd424b31be226eac6da76ca693e83c73fed865610a4937e"'), ('X-OAuth-Scopes', 'admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2023-07-05 17:42:21 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4905'), ('X-RateLimit-Reset', '1687981543'), ('X-RateLimit-Used', '95'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', '6FD1:95BE:1234AD:24C286:649C87BD')]
{}
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/variables/variable-name/repositories
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"total_count": 2, "repositories": [{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}, {"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}]}
@@ -1,10 +0,0 @@
https
DELETE
api.github.com
None
/orgs/BeaverSoftware/actions/secrets/secret-name
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
204
[('Date', 'Fri, 17 Apr 2020 00:12:33 GMT'), ('Server', 'GitHub.com'), ('Content-Length', '2'), ('Content-Type', 'application/json; charset=utf-8'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4984'), ('X-RateLimit-Reset', '1587085388'), ('X-OAuth-Scopes', 'read:org, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Vary', 'Accept-Encoding, Accept, X-Requested-With'), ('X-GitHub-Request-Id', 'C290:52DA:50234:B404B:5E98F470')]
{}
@@ -0,0 +1,43 @@
https
GET
api.github.com
None
/repos/BeaverSoftware/TestPyGithub
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Accept': 'application/vnd.github.nebula-preview+json'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}
https
GET
api.github.com
None
/repos/BeaverSoftware/FatherBeaver
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Accept': 'application/vnd.github.nebula-preview+json'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/secrets/secret-name
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"name": "secret-name","created_at": "2019-08-10T14:59:22Z","updated_at": "2020-01-10T14:59:22Z","visibility": "selected","selected_repositories_url": "https://api.github.com/orgs/BeaverSoftware/actions/secrets/secret-name/repositories"}
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/secrets/secret-name/repositories
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"total_count": 2, "repositories": [{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}, {"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}]}
@@ -0,0 +1,10 @@
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/secrets
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"total_count": 1, "secrets": [{"name": "secret-name","created_at": "2019-08-10T14:59:22Z","updated_at": "2020-01-10T14:59:22Z","visibility": "selected","selected_repositories_url": "https://api.github.com/orgs/BeaverSoftware/actions/secrets/secret-name/repositories"}]}
@@ -0,0 +1,43 @@
https
GET
api.github.com
None
/repos/BeaverSoftware/TestPyGithub
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Accept': 'application/vnd.github.nebula-preview+json'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}
https
GET
api.github.com
None
/repos/BeaverSoftware/FatherBeaver
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Accept': 'application/vnd.github.nebula-preview+json'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/variables/variable-name
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"name": "variable-name","value": "variable-value123","created_at": "2019-08-10T14:59:22Z","updated_at": "2020-01-10T14:59:22Z","visibility": "selected","selected_repositories_url": "https://api.github.com/orgs/BeaverSoftware/actions/variables/variable-name/repositories"}
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/variables/variable-name/repositories
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"total_count": 2, "repositories": [{"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","updated_at":"2012-04-25T06:51:38Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","has_wiki":true,"has_pages":false,"has_issues":false,"fork":false,"forks":0,"mirror_url":null,"size":112,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"TestPyGithub","language":null,"description":"Guinea-pig for PyGithub testing","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-03-03T08:57:40Z","created_at":"2012-03-03T07:53:19Z","id":3609352,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"}, {"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","has_wiki":true,"has_pages":true,"has_issues":true,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","full_name":"BeaverSoftware/FatherBeaver"}]}
@@ -0,0 +1,10 @@
https
GET
api.github.com
None
/orgs/BeaverSoftware/actions/variables
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"total_count": 1, "variables": [{"name": "variable-name","created_at": "2019-08-10T14:59:22Z","updated_at": "2020-01-10T14:59:22Z","visibility": "selected","selected_repositories_url": "https://api.github.com/orgs/BeaverSoftware/actions/variables/variable-name/repositories"}]}
+5 -7
View File
@@ -431,10 +431,8 @@ class Repository(Framework.TestCase):
def testCreateSecret(self, encrypt):
# encrypt returns a non-deterministic value, we need to mock it so the replay data matches
encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"
self.assertTrue(self.repo.create_secret("secret-name", "secret-value"))
def testDeleteSecret(self):
self.assertTrue(self.repo.delete_secret("secret_name"))
secret = self.repo.create_secret("secret-name", "secret-value")
self.assertIsNotNone(secret)
def testCodeScanAlerts(self):
codescan_alerts = self.repo.get_codescan_alerts()
@@ -1825,9 +1823,9 @@ class Repository(Framework.TestCase):
self.assertEqual("refs/tags/v0.6", refs[5].ref)
def testRepoVariable(self):
self.assertTrue(self.repo.create_variable("variable_name", "variable-value"))
self.assertTrue(self.repo.update_variable("variable_name", "variable-value123"))
self.assertTrue(self.repo.delete_variable("variable_name"))
variable = self.repo.create_variable("variable_name", "variable-value")
self.assertTrue(variable.edit("variable-value123"))
variable.delete()
class LazyRepository(Framework.TestCase):