Skip to content

Commit

Permalink
use the current release for the markdown title (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman authored Oct 21, 2021
1 parent bada600 commit aefae60
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/create_github_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"time"

"github.com/anchore/chronicle/chronicle/release"
"github.com/anchore/chronicle/chronicle/release/change"
Expand All @@ -10,6 +11,7 @@ import (
"github.com/anchore/chronicle/internal/log"
)

// nolint:funlen
func createChangelogFromGithub() (*release.Description, error) {
summer, err := github.NewChangeSummarizer(appConfig.CliOptions.RepoPath, appConfig.Github.ToGithubConfig())
if err != nil {
Expand All @@ -31,8 +33,10 @@ func createChangelogFromGithub() (*release.Description, error) {
log.Infof("since ref=%q date=%q", lastRelease.Version, lastRelease.Date)

releaseVersion := appConfig.UntilTag
releaseDisplayVersion := releaseVersion
if releaseVersion == "" {
releaseVersion = "(unreleased)"
releaseVersion = "(Unreleased)"
releaseDisplayVersion = releaseVersion
// check if the current commit is tagged, then use that
releaseTag, err := git.HeadTagOrCommit(appConfig.CliOptions.RepoPath)
if err != nil {
Expand Down Expand Up @@ -61,7 +65,10 @@ func createChangelogFromGithub() (*release.Description, error) {
}

return &release.Description{
Release: *lastRelease,
Release: release.Release{
Version: releaseDisplayVersion,
Date: time.Now(),
},
VCSTagURL: summer.TagURL(lastRelease.Version),
VCSChangesURL: summer.ChangesURL(lastRelease.Version, appConfig.UntilTag),
Changes: changes,
Expand Down

0 comments on commit aefae60

Please sign in to comment.