GitHub releases can reference an annotated tag, which is a git object that points to another git object. Currently, we assume that the annotated tag points to a commit:
|
// Resolve tag to commit sha |
|
tag, res, err := g.client.Git.GetTag(context.TODO(), g.owner, g.repository, *ref.Object.SHA) |
|
|
|
if err != nil { |
|
return "", err |
|
} |
|
|
|
res.Body.Close() |
|
|
|
if *tag.Object.Type != "commit" { |
|
return "", fmt.Errorf("could not resolve tag %q to commit: returned type is not 'commit'", tagName) |
|
} |
However, an annotated tag can point to another annotated tag (which then points to a commit), which is a case we don't handle. In general, there could be an arbitrarily long chain of tags before resolving to a commit.
example problematic release - https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc90
GitHub releases can reference an annotated tag, which is a git object that points to another git object. Currently, we assume that the annotated tag points to a commit:
github-release-resource/github.go
Lines 298 to 309 in af189e0
However, an annotated tag can point to another annotated tag (which then points to a commit), which is a case we don't handle. In general, there could be an arbitrarily long chain of tags before resolving to a commit.
example problematic release - https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc90