简体   繁体   中英

Why my Github new Github tag pulling in commits for my entire branch's history?

I am currently trying to implement an automated release GHA. One of the main features is that it will generate release notes based on previous tags. For some reason every time I generate release notes, Github will populate the release notes with every single branch that has been merged into the branch that I am creating release notes for. It should only be creating release notes for branches that have been merged between tags.

For example, I'm upgrading my repo's version from tag v1.1 to tag v1.2

When generating release notes it will pull in every merge from the branch I am adding a tag to since the beginning of the entire repo. Instead it should only pull in merges since v1.1

I think this might have to do with the fact that my tags aren't properly attached to branches. I am using this command in my GHA action script to get my previous tag.

git describe --tags --abbrev=0

This returns:

fatal: No tags can describe 'ExampleGitSHA'

It seems that GitHub is not recognizing my previous tags for whatever reason.

Following actions/checkout issue 701 , check if your git describe --tags --abbrev=0 fails because your GitHub Action did not fetch any tag.

If that is the case, add a step after the actions/checkout :

      - name: Checkout
        uses: actions/checkout@v3

      - name: Get tags
        run: git fetch --tags origin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM