mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
fix: crash when running in repo without any tags (#190)
Recent changes in v0.5.1 introduced a bug that caused releaser-pleaser to crash when running in a repository that contained no tags at all. This fixes the issue by checking if there is a tag before using it in the logger. Bug was introduced in #174.
This commit is contained in:
parent
81a855f5ab
commit
5f1849106c
1 changed files with 5 additions and 1 deletions
|
|
@ -327,7 +327,11 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error {
|
|||
}
|
||||
|
||||
func (rp *ReleaserPleaser) analyzedCommitsSince(ctx context.Context, since *git.Tag) ([]commitparser.AnalyzedCommit, error) {
|
||||
logger := rp.logger.With("method", "analyzedCommitsSince", "tag.hash", since.Hash, "tag.name", since.Name)
|
||||
logger := rp.logger.With("method", "analyzedCommitsSince")
|
||||
|
||||
if since != nil {
|
||||
logger = rp.logger.With("tag.hash", since.Hash, "tag.name", since.Name)
|
||||
}
|
||||
|
||||
commits, err := rp.forge.CommitsSince(ctx, since)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue