From 83dccb75e3e226cb2d9e6b9822400e51858ea657 Mon Sep 17 00:00:00 2001 From: Sam Yuan Date: Tue, 21 Nov 2023 22:34:22 +0800 Subject: [PATCH] CI: add for vendor check fix for #1072 Signed-off-by: Sam Yuan --- .github/workflows/golang.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/golang.yml b/.github/workflows/golang.yml index 74dcbe05f8..82ee7744b7 100644 --- a/.github/workflows/golang.yml +++ b/.github/workflows/golang.yml @@ -58,4 +58,22 @@ jobs: with: go-version-file: go.mod - name: run vulnerability detect - run: make govulncheck \ No newline at end of file + run: make govulncheck + + vendor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - name: run go mod check + run: go mod tidy && go mod vendor + - name: Compare the expected and actual vendor directories + run: | + if [ "$(git diff --ignore-space-at-eol vendor/ | wc -l)" -gt "0" ]; then + echo "Detected different on vendor folder. See status below:" + git diff + exit 1 + fi + id: diff \ No newline at end of file