Do not assume that the default branch of a project is called "master"
The default branch of a Git repository is not anymore "master" by default, but it is user-defined and "main" is more common nowadays.
We should to change the logic of the scripts such that "HEAD" does not mean "master", but rather points to the default branch.