docker-build-tools-ci icon indicating copy to clipboard operation
docker-build-tools-ci copied to clipboard

Add logic to try and fetch the default branch from Git

Open davereid-pfg opened this issue 4 years ago • 2 comments

Because Github now uses main as the default Git branch by default, anyone using this script on their site will now have to always set the DEFAULT_BRANCH CircleCI variable to get this script to work for multidev environments. Can we try and add some logic to check what the default branch is by default using Git itself?

Reference: https://davidwalsh.name/get-default-branch-name

davereid-pfg avatar Jan 26 '21 17:01 davereid-pfg

Alternatively, we could skip the Git remote logic call and just update the default to main but this would break builds on projects with a default branch of master still.

davereid-pfg avatar Jan 26 '21 17:01 davereid-pfg

Occasionally we make breaking changes and bump up the major version here e.g. we could go to 7.x and default to main there.

greg-1-anderson avatar Jan 26 '21 17:01 greg-1-anderson