Skip to content

Commit ff65814

Browse files
authored
Update breaking-change to check against last published version (#454)
* Update breaking-change to check against last published version * Fetch tags
1 parent ce44755 commit ff65814

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/build-check.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ jobs:
8888
runs-on: ubuntu-latest
8989
steps:
9090
- uses: actions/checkout@v2
91+
# breaking-change checks against last published release which is determined
92+
# using the last published tag
93+
- name: Get tags
94+
run: git fetch --tags origin
9195
- name: Run make breaking-change with json output to annotate PR
9296
# Formats JSON output into Github workflow commands
9397
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ BUF_DOCKER ?= bufbuild/buf:1.7.0
2222

2323
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path=${PWD}
2424
BUF := docker run --rm -v "${PWD}:/workspace" -w /workspace ${BUF_DOCKER}
25-
# When checking for protobuf breaking changes, check against the upstream repo's main branch.
25+
# When checking for protobuf breaking changes, check against the latest release tag
26+
LAST_RELEASE_TAG := $(shell git tag --sort=committerdate | tail -1)
2627
# Options are described in https://docs.buf.build/breaking/usage#git
27-
BUF_AGAINST ?= "https://github.com/open-telemetry/opentelemetry-proto.git"
28+
BUF_AGAINST ?= "https://github.com/open-telemetry/opentelemetry-proto.git\#tag=$(LAST_RELEASE_TAG)"
2829

2930
PROTO_GEN_CPP_DIR ?= $(GENDIR)/cpp
3031
PROTO_GEN_CSHARP_DIR ?= $(GENDIR)/csharp

0 commit comments

Comments
 (0)