File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
readthedocs/projects/views Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,7 @@ def process_step(self, form):
357
357
# pylint: disable=too-many-nested-blocks
358
358
if isinstance (form , ProjectBasicsForm ):
359
359
remote_repository = form .cleaned_data .get ("remote_repository" )
360
+ default_branch = form .cleaned_data .get ("default_branch" )
360
361
if remote_repository and remote_repository .vcs_provider == GITHUB :
361
362
remote_repository_relations = (
362
363
remote_repository .remote_repository_relations .filter (
@@ -377,8 +378,11 @@ def process_step(self, form):
377
378
"readthedocs.yml" ,
378
379
]:
379
380
try :
381
+ querystrings = (
382
+ f"?ref={ default_branch } " if default_branch else ""
383
+ )
380
384
response = session .head (
381
- f"https://api.github.com/repos/{ remote_repository .full_name } /contents/{ yaml } " ,
385
+ f"https://api.github.com/repos/{ remote_repository .full_name } /contents/{ yaml } { querystrings } " ,
382
386
timeout = 1 ,
383
387
)
384
388
if response .ok :
You can’t perform that action at this time.
0 commit comments