goreadme icon indicating copy to clipboard operation
goreadme copied to clipboard

Hardcoded Branch Name

Open Fishwaldo opened this issue 4 years ago • 1 comments

Seems for some of the badges, the Branch name is hardcoded into the template. Would be good to make that dynamic as Github has changed the defaults from master to main on new repositories

I see a attempt to fix this was made in #102 (along with other fixes). Could that be cherry picked out?

Fishwaldo avatar Sep 22 '21 14:09 Fishwaldo

Unfortunately not easily. After I implemented this fix, @posener significantly changed the library 😕.

If this is really important to you, you can just use my fork by referencing the latest commit sha. It will reference whatever your default branch is. It can also add a github action badge to your readme. You can see both in action here.

docs:
    needs: build
    runs-on: ubuntu-latest
    steps:
    - name: Check out repository
      uses: actions/checkout@v2
    - name: Update readme according to Go doc
      uses: posener/goreadme@e713475bae0c17d5083f4378c5e53d6c66d74c74
      with:
        email: '[email protected]'
        badge-codecov: true
        badge-godoc: true
        badge-github: "ci.yml"  # optional for a github action badge. all the others are standard
        badge-goreportcard: true
        badge-travisci: false
        commit-message: 'improvement(docs): updated docs'
        types: true
        functions: true
        github-token: '${{ secrets.GITHUB_TOKEN }}'

marksalpeter avatar Dec 02 '21 08:12 marksalpeter