Skip to content

Commit 87a0e1b

Browse files
fix error
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
1 parent 1df7faf commit 87a0e1b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,18 @@ jobs:
6464
uses: actions/setup-go@v4
6565
with:
6666
go-version: 1.20.x
67+
- name: Checkout code
68+
uses: actions/checkout@v3
6769
- name: generate license mirror
68-
run: make mirror-licenses
70+
run: |
71+
make mirror-licenses
6972
- name: lint-licenses
7073
# if restricted > 0, CI will report an error.
71-
run: make lint-licenses | grep -q 'restricted, [1-9][0-9]*' && exit 1 || true
74+
run: |
75+
result=$(make lint-licenses | awk '{print $7}')
76+
if [ $result -ne 0 ]; then
77+
exit 1
78+
fi
7279
test:
7380
name: Unit test
7481
runs-on: ubuntu-22.04

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ mod-download-go:
100100

101101
.PHONY: mirror-licenses
102102
mirror-licenses: mod-download-go; \
103-
@go install istio.io/tools/cmd/license-lint@latest; \
104-
@rm -fr licenses; \
105-
@license-lint --mirror
103+
go install istio.io/tools/cmd/license-lint@latest; \
104+
rm -fr licenses; \
105+
license-lint --mirror
106106

107107
.PHONY: lint-licenses
108108
lint-licenses:

0 commit comments

Comments
 (0)