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

Method revoke_credit

github/RepositoryAdvisory.py:231–248  ·  view source on GitHub ↗

:calls: `PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} `_

(self, login_or_user: str | github.NamedUser.NamedUser)

Source from the content-addressed store, hash-verified

229 self._useAttributes(data)
230
231 def revoke_credit(self, login_or_user: str | github.NamedUser.NamedUser) -> None:
232 """
233 :calls: `PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} <https://docs.github.com/en/rest/security-advisories/repository-advisories>`_
234 """
235 assert isinstance(login_or_user, (str, github.NamedUser.NamedUser)), login_or_user
236 if isinstance(login_or_user, github.NamedUser.NamedUser):
237 login_or_user = login_or_user.login
238 patch_parameters = {
239 "credits": [
240 dict(login=credit.login, type=credit.type) for credit in self.credits if credit.login != login_or_user
241 ]
242 }
243 headers, data = self._requester.requestJsonAndCheck(
244 "PATCH",
245 self.url,
246 input=patch_parameters,
247 )
248 self._useAttributes(data)
249
250 def clear_credits(self) -> None:
251 """

Callers 1

testRemoveCreditMethod · 0.80

Calls 2

_useAttributesMethod · 0.95
requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected