intuit / auto

Generate releases based on semantic version labels on pull requests.
https://intuit.github.io/auto/
MIT License
2.25k stars 202 forks source link

Incorrect Tag Version when Using Releasing in a GitHub action #2471

Open icirellik opened 3 weeks ago

icirellik commented 3 weeks ago

Describe the bug

I am trying to run auto using only the git-tag plugin to release a Terraform module from a GitHub action. When I run auto shipit -vv the action creates an incorrect tag which gets pushed to GitHub. The odd thing is that the changelog is updated with the correct version.

The current release in my repository is v1.0.0, when I run shipit it creates a new tag for v0.0.1 and pushes that while failing to create the GitHub release.

It also updates and pushes the CHANGELOG correctly.

There is no issue if I rule the release locally, and the dry run also determines the correct version to bump.

To Reproduce

I've created a minimal repository that will reproduce the issue.

https://github.com/icirellik/auto-bug

Expected behavior

I would expect a patch release v1.0.1 when the current release is v1.0.0.

Screenshots

Environment information:

Run npx auto info

Environment Information:

"auto" version: v11.2.0
"git"  version: v2.4[6](https://github.com/icirellik/auto-bug/actions/runs/10459809411/job/28964594314#step:6:7).0
"node" version: v20.16.0

Project Information:

✔ Repository:      icirellik/auto-bug (​https://github.com/icirellik/auto-bug​)
✔ Author Name:     Test User
✔ Author Email:    test@example.org
✔ Current Version: v1.0.0
✔ Latest Release:  v1.0.0 (​https://github.com/icirellik/auto-bug/releases/tag/v1.0.0​)

✔ Labels configured on GitHub project 

GitHub Token Information:

✔ Token:            [Token starting with ghp_]
✔ Repo Permission:  admin
✔ User:             icirellik
✔ API:              undefined (​undefined​)
✔ Enabled Scopes:   admin:enterprise, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, audit_log, codespace, copilot, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages
✔ Rate Limit:       4[9](https://github.com/icirellik/auto-bug/actions/runs/10459809411/job/28964594314#step:6:10)92/5000

Additional context

icirellik commented 3 weeks ago

The bug appears to be related to this line which always errors and returns 0.0.0:

https://github.com/intuit/auto/blob/main/plugins/git-tag/src/index.ts#L21