Script update_repos.sh
has hardcoded master
branch which breaks for some repos which use main
.
#11255
Labels
update_repos.sh
has hardcoded master
branch which breaks for some repos which use main
.
#11255
Problem description
The script
update_repos.sh
, on lines #77 & 78 has a hardcoded reference to themaster
branch. Many repos use an preferred naming convention ofmain
(example: pulumi-tls. This means thegit checkout
andgit pull origin
commands will not work as expected if the target repo is using themain
naming convention, meaning that after the initial clone, updates may not be seen for those repo's docs.Suggestions for a fix
Rather than hardcoding the branch name, derive it using the following command, saving the output into a variable. Refer to the variable in the git command rather than a hardcoded string:
Additionally, I suggest auditing other code to see if there are other places where the primary branch is assumed to be named
master
.The text was updated successfully, but these errors were encountered: