:calls: `POST /repos/{owner}/{repo}/actions/variables/{name} `_
(self, variable_name: str, value: str)
| 2065 | return github.Secret.Secret(self._requester, url=url) |
| 2066 | |
| 2067 | def create_variable(self, variable_name: str, value: str) -> github.Variable.Variable: |
| 2068 | """ |
| 2069 | :calls: `POST /repos/{owner}/{repo}/actions/variables/{name} <https://docs.github.com/en/rest/actions/variables#create-a-repository-variable>`_ |
| 2070 | """ |
| 2071 | assert isinstance(variable_name, str), variable_name |
| 2072 | assert isinstance(value, str), value |
| 2073 | post_parameters = { |
| 2074 | "name": variable_name, |
| 2075 | "value": value, |
| 2076 | } |
| 2077 | self._requester.requestJsonAndCheck("POST", f"{self.url}/actions/variables", input=post_parameters) |
| 2078 | |
| 2079 | quoted_variable_name = urllib.parse.quote(variable_name, safe="") |
| 2080 | url = f"{self.url}/actions/variables/{quoted_variable_name}" |
| 2081 | return github.Variable.Variable( |
| 2082 | self._requester, |
| 2083 | url=url, |
| 2084 | attributes={ |
| 2085 | "name": variable_name, |
| 2086 | "value": value, |
| 2087 | }, |
| 2088 | completed=False, |
| 2089 | ) |
| 2090 | |
| 2091 | def get_variables(self) -> PaginatedList[github.Variable.Variable]: |
| 2092 | """ |
no test coverage detected