cookpete / auto-changelog

Command line tool for generating a changelog from git tags and commit history
MIT License
1.28k stars 157 forks source link

Only getting the last commit on "CHANGELOG.md" #275

Open felipe-frade opened 1 year ago

felipe-frade commented 1 year ago

My first Issue open in any github project.

When runned (auto-changelog) localy its beatfull, but when the github runs in the workflow, doesnt.

The action is made on a merge. I use npm. It run: auto-changelog -p --template changelog-template.hbs --commit-limit false && git add CHANGELOG.md.

But always get only the last commit. Anyone knows why ?

ljharb commented 1 year ago

--commit-limit=false?

felipe-frade commented 1 year ago

I try, but yet only one :(

felipe-frade commented 1 year ago

my repo: https://github.com/felipe-frade/github-actions-test-2

and the log

teste@1.10.0 version /home/runner/work/github-actions-test-2/github-actions-test-2 auto-changelog -p --template changelog-template.hbs --commit-limit false && git add CHANGELOG.md

auto-changelog: Fetching tags…auto-changelog: 2 version tags found…auto-changelog: Fetched v1.10.0…auto-changelog: Fetched v1.10.0…auto-changelog: 1 kB written to CHANGELOG.md

teste@1.10.0 version-json /home/runner/work/github-actions-test-2/github-actions-test-2 auto-changelog --template json --output changelog-data.json

auto-changelog: Fetching tags…auto-changelog: 1 version tags found…auto-changelog: Fetched v1.10.0…auto-changelog: 1 kB written to changelog-data.json

benwk commented 1 year ago

Hi @felipe-frade, I got a similar problem today. Just try adding fetch-depth: 0 to the Checkout step:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          # default depth is 1, which is not enough for changelog generation
          fetch-depth: 0

HTH :)