Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log grabs too many commit messages when tag is not latest #7

Closed
sdinay opened this issue Feb 16, 2022 · 2 comments
Closed

Change log grabs too many commit messages when tag is not latest #7

sdinay opened this issue Feb 16, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@sdinay
Copy link

sdinay commented Feb 16, 2022

Recreate:

  1. Create and push some commits to your default (main) branch.
  2. List your commits. Let's say your commits look like this:
$ git log --pretty=oneline
15027957951b64cf874c3557a0f3547bd83b3ff6 Merge branch 'experiment'
a6b4c97498bd301d84096da251c98a07c7723e65 feat: Create write support
0d52aaab4479697da7686c15f77a3d64d9165190 feat: One more thing
6d52a271eda8725415634dd79daabbc4d9b6008e Merge branch 'experiment'
0b7434d86859cc7b8c3d5e1dddfed66ff742fcbc feat: Add commit function
9fceb02d0ae598e95dc970b74767f19372d61af8 feat: Update rakefile
  1. Create a tag with an older commit than the most recent on in the main branch.
git tag v1.2 0b7434d
git push origin v1.2

The release github action is triggered:

name: Create Release

on:
  push:
    tags:
      - 'v*'
jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Changelog
        id: changelog
        uses: ardalanamini/auto-changelog@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

The ${{ steps.changelog.outputs.changelog }} value will include all the commits:

Create write support
One more thing
Add commit function
Update rakefile

It should just checkout the tag and include only the changes between the previous tag and the current tag. Or if this is the first tag of the repository, it should include everything up to just the commit the tag refers to.

@ardalanamini
Copy link
Owner

Hi @sdinay,

Just to clarify, for example, you created the tag on the One more thing commit, but the changelog contains all the commits after that as well? 🤔

@ardalanamini ardalanamini self-assigned this Feb 20, 2022
@ardalanamini ardalanamini added the bug Something isn't working label Feb 20, 2022
@ardalanamini
Copy link
Owner

@sdinay Try again with the latest version (v1.2.1 or v1), it should be fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants