mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-21 01:51:26 +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 {
|
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{
|
repo.Tags = append(repo.Tags, TagDetails{
|
||||||
Name: ref.Name().Short(),
|
Name: tagName,
|
||||||
Hash: ref.Hash().String(),
|
Hash: commitHash,
|
||||||
})
|
})
|
||||||
|
|
||||||
Debug("Found tag", map[string]interface{}{
|
Debug("Found tag", map[string]interface{}{
|
||||||
"tag": ref.Name().Short(),
|
"tag": tagName,
|
||||||
"hash": ref.Hash().String(),
|
"hash": commitHash,
|
||||||
})
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
+13
-22
@@ -1,22 +1,13 @@
|
|||||||
version: 1
|
version: 1
|
||||||
force:
|
force:
|
||||||
major: 1
|
major: 1
|
||||||
minor: 4
|
minor: 16 # Start from v1.16.x
|
||||||
existing: true
|
existing: true
|
||||||
strict: false
|
strict: false
|
||||||
commit: 960207e4677476ad31a9f389f74eaf9f33d49613
|
commit: 960207e4677476ad31a9f389f74eaf9f33d49613
|
||||||
# tag_prefixes: (optional) prefixes to strip from existing tags
|
wording:
|
||||||
# Note: "v" prefix is always stripped automatically
|
minor:
|
||||||
# tag_prefixes:
|
- change
|
||||||
# - "app-"
|
- improve
|
||||||
# - "service-"
|
major:
|
||||||
wording:
|
- breaking
|
||||||
patch:
|
|
||||||
- update
|
|
||||||
- initial
|
|
||||||
- fix
|
|
||||||
minor:
|
|
||||||
- change
|
|
||||||
- improve
|
|
||||||
major:
|
|
||||||
- breaking
|
|
||||||
Reference in New Issue
Block a user