From f0f00e17b17bb3c79456e52c5b2f817b2981acde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 6 Dec 2021 11:07:00 +0000 Subject: [PATCH] enable changelog on edge branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- Makefile | 4 ++-- changelog/unreleased/enable-edge-changelog.md | 5 +++++ tools/check-changelog/main.go | 11 ++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/enable-edge-changelog.md diff --git a/Makefile b/Makefile index 465a71ef9b..0c737ea19b 100644 --- a/Makefile +++ b/Makefile @@ -93,10 +93,10 @@ gen-doc: check-changelog: release-deps `go env GOPATH`/bin/calens > /dev/null - go run tools/check-changelog/main.go + go run tools/check-changelog/main.go -branch edge check-changelog-drone: - go run tools/check-changelog/main.go -repo origin -pr "$(PR)" + go run tools/check-changelog/main.go -repo origin -branch edge -pr "$(PR)" # to be run in CI platform ci: build-ci test lint-ci diff --git a/changelog/unreleased/enable-edge-changelog.md b/changelog/unreleased/enable-edge-changelog.md new file mode 100644 index 0000000000..1de0ffe76d --- /dev/null +++ b/changelog/unreleased/enable-edge-changelog.md @@ -0,0 +1,5 @@ +Bugfix: enable changelog on edge branch + +We added a `branch` flag to the `tools/check-changelog/main.go` to fix changelog checks on the edge branch. + +https://github.com/cs3org/reva/pull/2327 \ No newline at end of file diff --git a/tools/check-changelog/main.go b/tools/check-changelog/main.go index edf64ee198..86c6510f17 100644 --- a/tools/check-changelog/main.go +++ b/tools/check-changelog/main.go @@ -59,6 +59,7 @@ func skipPR(prID int) bool { func main() { repo := flag.String("repo", "", "the remote repo against which diff-index is to be derived") + branch := flag.String("branch", "master", "the branch against which diff-index is to be derived") prID := flag.Int("pr", 0, "the ID of the PR") flag.Parse() @@ -66,12 +67,12 @@ func main() { return } - branch := "master" if *repo != "" { - branch = *repo + "/master" + s := *repo + "/" + *branch + branch = &s } - cmd := exec.Command("git", "diff-index", branch, "--", ".") + cmd := exec.Command("git", "diff-index", *branch, "--", ".") out, err := cmd.Output() if err != nil { log.Fatal(err) @@ -81,7 +82,7 @@ func main() { return } - cmd = exec.Command("git", "diff-index", branch, "--", "changelog/unreleased") + cmd = exec.Command("git", "diff-index", *branch, "--", "changelog/unreleased") out, err = cmd.Output() if err != nil { log.Fatal(err) @@ -96,5 +97,5 @@ func main() { } } - log.Fatal(errors.New("No changelog added. Please create a changelog item based on your changes")) + log.Fatal(errors.New("no changelog added. Please create a changelog item based on your changes")) }