Fix remote check proto breaking when not branching from master (#1409)

* fix check remote breaking when not branching from master -- always use
current git branch when ref'ing

* fix remote command when overridden
This commit is contained in:
Nick DeLuca 2022-11-30 11:48:00 -07:00 committed by GitHub
parent a4de1b7fb7
commit 252fafa53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,7 @@ jobs:
- run: make check-proto-lint
- run: make check-proto-format
- run: make check-proto-breaking-remote
- run: BUF_CHECK_BREAKING_AGAINST="branch=$GITHUB_BASE_REF" make check-proto-breaking-remote
- run: BUF_CHECK_BREAKING_AGAINST_REMOTE="branch=$GITHUB_BASE_REF" make check-proto-breaking-remote
if: github.event_name == 'pull_request'
- run: make check-proto-gen
- run: make check-proto-gen-doc

View File

@ -44,6 +44,7 @@ check-proto-format: proto-format
@git diff --exit-code proto/**/*.proto > /dev/null || (echo "Protobuf format is not up to date! Please run \`make proto-format\`."; exit 1)
BUF_CHECK_BREAKING_AGAINST ?= ref=HEAD~1
BUF_CHECK_BREAKING_AGAINST_REMOTE ?= branch=$(GIT_BRANCH),$(BUF_CHECK_BREAKING_AGAINST)
.PHONY: check-proto-breaking
check-proto-breaking: install-build-deps
@ -53,7 +54,7 @@ check-proto-breaking: install-build-deps
.PHONY: check-proto-breaking-remote
check-proto-breaking-remote: install-build-deps
@echo "Checking for proto backward compatibility"
@$(BUF) breaking --against '$(HTTPS_GIT)#$(BUF_CHECK_BREAKING_AGAINST)'
$(BUF) breaking --against '$(HTTPS_GIT)#$(BUF_CHECK_BREAKING_AGAINST_REMOTE)'
.PHONY: proto-gen-all
proto-gen-all: proto-gen proto-gen-doc proto-gen-swagger