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

Method offer_credits

github/RepositoryAdvisory.py:202–229  ·  view source on GitHub ↗

Offers credit to a list of users for a vulnerability in a repository. Unless you are giving credit to yourself, the user having credit offered will need to explicitly accept the credit. :calls: `PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} <https://docs.github.

(
        self,
        credited: Iterable[Credit],
    )

Source from the content-addressed store, hash-verified

200 self.offer_credits([{"login": login_or_user, "type": credit_type}])
201
202 def offer_credits(
203 self,
204 credited: Iterable[Credit],
205 ) -> None:
206 """
207 Offers credit to a list of users for a vulnerability in a repository.
208
209 Unless you are giving credit to yourself, the user having credit offered will need to explicitly accept the credit.
210 :calls: `PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} <https://docs.github.com/en/rest/security-advisories/repository-advisories>`
211 :param credited: iterable of dict with keys "login" and "type"
212
213 """
214 assert isinstance(credited, Iterable), credited
215 for credit in credited:
216 github.AdvisoryCredit.AdvisoryCredit._validate_credit(credit)
217
218 patch_parameters = {
219 "credits": [
220 github.AdvisoryCredit.AdvisoryCredit._to_github_dict(credit)
221 for credit in (self.credits + list(credited))
222 ]
223 }
224 headers, data = self._requester.requestJsonAndCheck(
225 "PATCH",
226 self.url,
227 input=patch_parameters,
228 )
229 self._useAttributes(data)
230
231 def revoke_credit(self, login_or_user: str | github.NamedUser.NamedUser) -> None:
232 """

Callers 2

offer_creditMethod · 0.95
testOfferCreditsMethod · 0.80

Calls 4

_useAttributesMethod · 0.95
_validate_creditMethod · 0.80
requestJsonAndCheckMethod · 0.80
_to_github_dictMethod · 0.45

Tested by

no test coverage detected