From 88871bb228aca5840be4ef5f2cadaa401f83aa21 Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Mon, 12 Aug 2024 07:19:03 +0000 Subject: [PATCH] ci: fix git diff Signed-off-by: zhangzujian --- .github/workflows/build-x86-image.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index db850acc5af4..875f682635bc 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -43,7 +43,7 @@ jobs: if [ ${{ github.event_name }} != 'pull_request' ]; then exit fi - if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then + if ! git diff --name-only --exit-code HEAD^...HEAD -- dist/images/Dockerfile.base; then echo build-base=1 >> "$GITHUB_OUTPUT" fi @@ -90,7 +90,7 @@ jobs: if [ ${{ github.event_name }} != 'pull_request' ]; then exit fi - if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base-dpdk$; then + if ! git diff --name-only --exit-code HEAD^...HEAD -- dist/images/Dockerfile.base-dpdk; then echo build-dpdk-base=1 >> "$GITHUB_OUTPUT" fi @@ -265,7 +265,7 @@ jobs: - name: Build run: | go mod tidy - git diff --exit-code go.mod go.sum + git diff --exit-code -- go.mod go.sum make lint if [ ${{ needs.build-kube-ovn-base.outputs.build-base || 0 }} = 1 ]; then make build-kube-ovn