Skip to content

Commit 5cbf694

Browse files
Merge pull request cri-o#3766 from openSUSE/release-1.18-branch-notes
[1.18] Allow release notes for release branches
2 parents bcc2ad4 + 508f201 commit 5cbf694

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

scripts/release-notes/release_notes.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ func run() error {
6565
}
6666
logrus.Infof("Using HEAD commit %s", head)
6767

68+
targetBranch := git.Master
69+
currentBranch, err := repo.CurrentBranch()
70+
if err != nil {
71+
return errors.Wrap(err, "get current branch")
72+
}
73+
logrus.Infof("Found current branch %s", currentBranch)
74+
if git.IsReleaseBranch(currentBranch) && currentBranch != git.Master {
75+
targetBranch = currentBranch
76+
}
77+
logrus.Infof("Using target branch %s", targetBranch)
78+
6879
logrus.Infof("Generating release notes")
6980
outputFile := endTag + ".md"
7081
outputFilePath := filepath.Join(outputPath, outputFile)
@@ -73,6 +84,7 @@ func run() error {
7384
"./build/bin/release-notes",
7485
"--github-org=cri-o",
7586
"--github-repo=cri-o",
87+
"--branch="+targetBranch,
7688
"--repo-path=/tmp/cri-o-repo",
7789
"--required-author=",
7890
"--start-rev="+startTag,
@@ -116,11 +128,6 @@ Download the static release bundle via our Google Cloud Bucket:
116128

117129
// Update gh-pages branch if not a pull request and running in CircleCI
118130
if util.IsEnvSet("CIRCLECI") && !util.IsEnvSet("CIRCLE_PULL_REQUEST") {
119-
currentBranch, err := repo.CurrentBranch()
120-
if err != nil {
121-
return errors.Wrap(err, "get current branch")
122-
}
123-
124131
logrus.Infof("Checking out branch %s", branch)
125132
if err := repo.Checkout(branch); err != nil {
126133
return errors.Wrapf(err, "checkout %s branch", branch)

0 commit comments

Comments
 (0)