MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / edit

Method edit

github/CheckRun.py:214–265  ·  view source on GitHub ↗

:calls: `PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} `_

(
        self,
        name: Opt[str] = NotSet,
        head_sha: Opt[str] = NotSet,
        details_url: Opt[str] = NotSet,
        external_id: Opt[str] = NotSet,
        status: Opt[str] = NotSet,
        started_at: Opt[datetime] = NotSet,
        conclusion: Opt[str] = NotSet,
        completed_at: Opt[datetime] = NotSet,
        output: Opt[dict] = NotSet,
        actions: Opt[list[dict]] = NotSet,
    )

Source from the content-addressed store, hash-verified

212 )
213
214 def edit(
215 self,
216 name: Opt[str] = NotSet,
217 head_sha: Opt[str] = NotSet,
218 details_url: Opt[str] = NotSet,
219 external_id: Opt[str] = NotSet,
220 status: Opt[str] = NotSet,
221 started_at: Opt[datetime] = NotSet,
222 conclusion: Opt[str] = NotSet,
223 completed_at: Opt[datetime] = NotSet,
224 output: Opt[dict] = NotSet,
225 actions: Opt[list[dict]] = NotSet,
226 ) -> None:
227 """
228 :calls: `PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} <https://docs.github.com/en/rest/reference/checks#update-a-check-run>`_
229 """
230 assert is_optional(name, str), name
231 assert is_optional(head_sha, str), head_sha
232 assert is_optional(details_url, str), details_url
233 assert is_optional(external_id, str), external_id
234 assert is_optional(status, str), status
235 assert is_optional(started_at, datetime), started_at
236 assert is_optional(conclusion, str), conclusion
237 assert is_optional(completed_at, datetime), completed_at
238 assert is_optional(output, dict), output
239 assert is_optional_list(actions, dict), actions
240
241 post_parameters: dict[str, Any] = {}
242 if is_defined(name):
243 post_parameters["name"] = name
244 if is_defined(head_sha):
245 post_parameters["head_sha"] = head_sha
246 if is_defined(details_url):
247 post_parameters["details_url"] = details_url
248 if is_defined(external_id):
249 post_parameters["external_id"] = external_id
250 if is_defined(status):
251 post_parameters["status"] = status
252 if is_defined(started_at):
253 post_parameters["started_at"] = started_at.strftime("%Y-%m-%dT%H:%M:%SZ")
254 if is_defined(completed_at):
255 post_parameters["completed_at"] = completed_at.strftime("%Y-%m-%dT%H:%M:%SZ")
256 if is_defined(conclusion):
257 post_parameters["conclusion"] = conclusion
258 if is_defined(output):
259 post_parameters["output"] = output
260 if is_defined(actions):
261 post_parameters["actions"] = actions
262
263 headers, data = self._requester.requestJsonAndCheck("PATCH", self.url, input=post_parameters)
264 self._useAttributes(data)
265 self._set_complete()
266
267 def _useAttributes(self, attributes: dict[str, Any]) -> None:
268 if "app" in attributes: # pragma no branch

Callers

nothing calls this directly

Calls 6

_useAttributesMethod · 0.95
is_optionalFunction · 0.90
is_optional_listFunction · 0.90
is_definedFunction · 0.90
requestJsonAndCheckMethod · 0.80
_set_completeMethod · 0.80

Tested by

no test coverage detected