riboseinc / jekyll-theme-open-project

Jekyll theme for site suite presenting your open software and specifications.
MIT License
30 stars 3 forks source link

Many Git repos have a default branch of "main" now instead of "master", need to support #77

Closed ronaldtse closed 3 years ago

ronaldtse commented 3 years ago

Jekyll runs fail because the git sub-site pulls assume that the Git branch is called "master".

Recently many repositories have been renaming their "master" branch into "main" to incorporate inclusive language.

This is a build failure seen on metanorma.org: https://github.com/metanorma/metanorma.org/runs/2703600508?check_suite_focus=true


`/opt/hostedtoolcache/Ruby/2.7.3/x64/lib/ruby/gems/2.7.0/gems/git-1.8.1/lib/git/lib.rb:1097:in `command': git '--git-dir=/home/runner/work/metanorma.org/metanorma.org/_software/metanorma-bipm/.git' '--work-tree=/home/runner/work/metanorma.org/metanorma.org/_software/metanorma-bipm' '-c' 'color.ui=false' checkout '--force' 'origin/master'  2>&1:error: pathspec 'origin/master' did not match any file(s) known to git (Git::GitExecuteError)
55
    from /opt/hostedtoolcache/Ruby/2.7.3/x64/lib/ruby/gems/2.7.0/gems/git-1.8.1/lib/git/lib.rb:750:in `checkout'
56
    from /opt/hostedtoolcache/Ruby/2.7.3/x64/lib/ruby/gems/2.7.0/gems/git-1.8.1/lib/git/base.rb:345:in `checkout'
57
    from /opt/hostedtoolcache/Ruby/2.7.3/x64/lib/ruby/gems/2.7.0/gems/jekyll-theme-open-project-helpers-2.1.5/lib/jekyll-theme-open-project-helpers/project_data_reader.rb:297:in `git_shallow_checkout'
58
    from /opt/hostedtoolcache/Ruby/2.7.3/x64/lib/ruby/gems/2.7.0/gems/jekyll-theme-open-project-helpers-2.1.5/lib/jekyll-theme-open-project-helpers/project_data_reader.rb:224:in `block in fetch_and_read_software'
59
    from /opt/hostedtoolcache/Ruby/2.7.3/x64/lib/ruby/gems/2.7.0/gems/jekyll-theme-open-project-helpers-2.1.5/lib/jekyll-theme-open-project-helpers/project_data_reader.rb:212:in `each'
60
``