File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1541,6 +1541,50 @@ def edit(
15411541 return True
15421542 return False
15431543
1544+ @decorators .requires_auth
1545+ def auto_trigger_checks (self , app_id , enabled = True ):
1546+ """Change preferences for automatic creation of check suites.
1547+
1548+ .. versionadded:: 1.3.0
1549+
1550+ Enable/disable the automatic flow when creating check suites.
1551+ By default, the check suite is automatically created each time code
1552+ is pushed. When the automatic creation is disable they can be created
1553+ manually.
1554+
1555+ :param int app_id:
1556+ (required), the id of the GitHub App
1557+ :param bool enabled
1558+ (optional), enable automatic creation of check suites
1559+ Default: True
1560+ :returns:
1561+ the check suite settings for this repository
1562+ :rtype:
1563+ dict
1564+ """
1565+ url = self ._build_url (
1566+ "check-suites" , "preferences" , base_url = self ._api
1567+ )
1568+ headers = {"Accept" : "application/vnd.github.antiope-preview+json" }
1569+ json = self ._json (
1570+ self ._patch (
1571+ url ,
1572+ headers = headers ,
1573+ data = jsonlib .dumps (
1574+ {
1575+ "auto_trigger_checks" : [
1576+ {"app_id" : app_id , "setting" : enabled }
1577+ ]
1578+ }
1579+ ),
1580+ ),
1581+ 200 ,
1582+ include_cache_info = False ,
1583+ )
1584+ if json and json .get ("repository" ):
1585+ del json ["repository" ]
1586+ return json
1587+
15441588 def events (self , number = - 1 , etag = None ):
15451589 """Iterate over events on this repository.
15461590
You can’t perform that action at this time.
0 commit comments