Skip to content

Commit 73996d0

Browse files
committed
Skip changelog generation if the the target path already exists
This avoids a build error when we have to rebuild a release and the changelog was already rotated in a previous build attempt.
1 parent fc5ee6c commit 73996d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

changelog/release.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ func ReleaseInPath(path string, version string, versionPattern *regexp.Regexp) e
3939
}
4040

4141
if utils.FileExists(versionChangelogPath) {
42-
return fmt.Errorf("target path already exists: %s", filepath.Join(path, versionChangelogPath))
42+
logger.Info("Target path already exists - skipping changelog release (%s)",
43+
filepath.Join(path, versionChangelogPath))
44+
return nil
4345
}
4446

4547
out, err := git.GitE("mv", "-v", unreleasedChangelogPath, versionChangelogPath)

0 commit comments

Comments
 (0)