Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script update_repos.sh has hardcoded master branch which breaks for some repos which use main. #11255

Closed
thoward opened this issue Apr 15, 2024 · 0 comments · Fixed by #11256
Closed
Assignees
Labels
needs-triage Needs attention from the triage team resolution/fixed This issue was fixed

Comments

@thoward
Copy link
Contributor

thoward commented Apr 15, 2024

Problem description

The script update_repos.sh, on lines #77 & 78 has a hardcoded reference to the master branch. Many repos use an preferred naming convention of main (example: pulumi-tls. This means the git checkout and git pull origin commands will not work as expected if the target repo is using the main 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:

git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4

Additionally, I suggest auditing other code to see if there are other places where the primary branch is assumed to be named master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs attention from the triage team resolution/fixed This issue was fixed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants