mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-17 01:31:51 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f205e9856 | |||
| a77bc0c7ae | |||
| 99338e8527 | |||
| 911513c106 | |||
| c2a7a4e156 | |||
| 21b87300cc |
+15
-4
@@ -179,14 +179,25 @@ func ListExistingTags(repo *GitRepository) {
|
||||
}
|
||||
|
||||
if err := refs.ForEach(func(ref *plumbing.Reference) error {
|
||||
tagName := ref.Name().Short()
|
||||
commitHash := ref.Hash().String()
|
||||
|
||||
// For annotated tags, dereference to get the actual commit hash
|
||||
tagObj, err := repo.Handler.TagObject(ref.Hash())
|
||||
if err == nil {
|
||||
// This is an annotated tag - get the commit it points to
|
||||
commitHash = tagObj.Target.String()
|
||||
}
|
||||
// If err != nil, it's a lightweight tag - ref.Hash() is already the commit hash
|
||||
|
||||
repo.Tags = append(repo.Tags, TagDetails{
|
||||
Name: ref.Name().Short(),
|
||||
Hash: ref.Hash().String(),
|
||||
Name: tagName,
|
||||
Hash: commitHash,
|
||||
})
|
||||
|
||||
Debug("Found tag", map[string]interface{}{
|
||||
"tag": ref.Name().Short(),
|
||||
"hash": ref.Hash().String(),
|
||||
"tag": tagName,
|
||||
"hash": commitHash,
|
||||
})
|
||||
|
||||
return nil
|
||||
|
||||
+13
-22
@@ -1,22 +1,13 @@
|
||||
version: 1
|
||||
force:
|
||||
major: 1
|
||||
minor: 4
|
||||
existing: true
|
||||
strict: false
|
||||
commit: 960207e4677476ad31a9f389f74eaf9f33d49613
|
||||
# tag_prefixes: (optional) prefixes to strip from existing tags
|
||||
# Note: "v" prefix is always stripped automatically
|
||||
# tag_prefixes:
|
||||
# - "app-"
|
||||
# - "service-"
|
||||
wording:
|
||||
patch:
|
||||
- update
|
||||
- initial
|
||||
- fix
|
||||
minor:
|
||||
- change
|
||||
- improve
|
||||
major:
|
||||
- breaking
|
||||
version: 1
|
||||
force:
|
||||
major: 1
|
||||
minor: 16 # Start from v1.16.x
|
||||
existing: true
|
||||
strict: false
|
||||
commit: 960207e4677476ad31a9f389f74eaf9f33d49613
|
||||
wording:
|
||||
minor:
|
||||
- change
|
||||
- improve
|
||||
major:
|
||||
- breaking
|
||||
Reference in New Issue
Block a user