mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Add code scanning alerts (#2227)
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
# Copyright 2018 Leying Chen <leyingc@andrew.cmu.edu> #
|
||||
# Copyright 2020 Pascal Hofmann <mail@pascalhofmann.de> #
|
||||
# Copyright 2022 Aleksei Fedotov <aleksei@fedotov.email> #
|
||||
# Copyright 2022 Eric Nieuwland <eric.nieuwland@gmail.com> #
|
||||
# #
|
||||
# This file is part of PyGithub. #
|
||||
# http://pygithub.readthedocs.io/ #
|
||||
@@ -98,6 +99,7 @@ import github.Branch
|
||||
import github.CheckRun
|
||||
import github.CheckSuite
|
||||
import github.Clones
|
||||
import github.CodeScanAlert
|
||||
import github.Commit
|
||||
import github.CommitComment
|
||||
import github.Comparison
|
||||
@@ -3772,6 +3774,18 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
return github.Artifact.Artifact(self._requester, headers, data, completed=True)
|
||||
|
||||
def get_codescan_alerts(self):
|
||||
"""
|
||||
:calls: `GET https://api.github.com/repos/{owner}/{repo}/code-scanning/alerts <https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository>`_
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CodeScanAlert.CodeScanAlert`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.CodeScanAlert.CodeScanAlert,
|
||||
self._requester,
|
||||
f"{self.url}/code-scanning/alerts",
|
||||
None,
|
||||
)
|
||||
|
||||
def _initAttributes(self):
|
||||
self._allow_merge_commit = github.GithubObject.NotSet
|
||||
self._allow_rebase_merge = github.GithubObject.NotSet
|
||||
|
||||
Reference in New Issue
Block a user