From cd09ef80110a86a472b4acfbfcdfa512d87d66ed Mon Sep 17 00:00:00 2001 From: Jim Larson Date: Wed, 3 Nov 2021 16:15:29 -0700 Subject: [PATCH] fix: make proto-check-breaking work for forks --- .github/workflows/proto.yml | 2 +- Makefile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 503bed0c43cd..bdc2cdbda5cb 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -26,5 +26,5 @@ jobs: PATTERNS: | **/**.proto - name: check-breakage - run: make proto-check-breaking + run: make proto-check-breaking PR_TARGET_REPO=https://github.com/${{ github.repository }}.git PR_TARGET_BRANCH=${{ github.base_ref }} if: env.GIT_DIFF diff --git a/Makefile b/Makefile index d3a653d50250..f6f5be9ac81d 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ BINDIR ?= $(GOPATH)/bin BUILDDIR ?= $(CURDIR)/build SIMAPP = ./simapp MOCKS_DIR = $(CURDIR)/tests/mocks -HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git +PR_TARGET_REPO = https://github.com/cosmos/cosmos-sdk.git +PR_TARGET_BRANCH = master DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf @@ -415,7 +416,7 @@ proto-lint: @$(DOCKER_BUF) lint --error-format=json proto-check-breaking: - @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=master + @$(DOCKER_BUF) breaking --against $(PR_TARGET_REPO)#branch=$(PR_TARGET_BRANCH) TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint