Skip to content

Commit

Permalink
Fix remote check proto breaking when not branching from master (#1409)
Browse files Browse the repository at this point in the history
* fix check remote breaking when not branching from master -- always use
current git branch when ref'ing

* fix remote command when overridden
  • Loading branch information
nddeluca committed Nov 30, 2022
1 parent cca8371 commit 84e758d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion build/proto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 84e758d

Please sign in to comment.