From 8332cf2d62c0ac2f23b5b29db235148e9c7ad58d Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Tue, 14 Mar 2023 14:45:37 -0500 Subject: [PATCH 1/2] Update breaking-change to check against last published version --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1d8c9965b..ac3020780 100755 --- a/Makefile +++ b/Makefile @@ -22,9 +22,10 @@ BUF_DOCKER ?= bufbuild/buf:1.7.0 PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path=${PWD} BUF := docker run --rm -v "${PWD}:/workspace" -w /workspace ${BUF_DOCKER} -# When checking for protobuf breaking changes, check against the upstream repo's main branch. +# When checking for protobuf breaking changes, check against the latest release tag +LAST_RELEASE_TAG := $(shell git tag --sort=committerdate | tail -1) # Options are described in https://docs.buf.build/breaking/usage#git -BUF_AGAINST ?= "https://github.com/open-telemetry/opentelemetry-proto.git" +BUF_AGAINST ?= "https://github.com/open-telemetry/opentelemetry-proto.git\#tag=$(LAST_RELEASE_TAG)" PROTO_GEN_CPP_DIR ?= $(GENDIR)/cpp PROTO_GEN_CSHARP_DIR ?= $(GENDIR)/csharp From 2bf15c4806071ff239c78a59885de1357a6359b9 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Wed, 15 Mar 2023 09:31:47 -0500 Subject: [PATCH 2/2] Fetch tags --- .github/workflows/build-check.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-check.yaml b/.github/workflows/build-check.yaml index 7f26bf39f..f8591b827 100644 --- a/.github/workflows/build-check.yaml +++ b/.github/workflows/build-check.yaml @@ -88,6 +88,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + # breaking-change checks against last published release which is determined + # using the last published tag + - name: Get tags + run: git fetch --tags origin - name: Run make breaking-change with json output to annotate PR # Formats JSON output into Github workflow commands # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message