Skip to content

Commit

Permalink
fix gosec some bug
Browse files Browse the repository at this point in the history
Signed-off-by: peng9808 <[email protected]>
  • Loading branch information
peng9808 committed Sep 13, 2024
1 parent d6c7a1d commit 0290596
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/period-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,25 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Remove old Go version
run: sudo rm -rf /usr/local/go
- name: Install Go
run: |
wget https://golang.org/dl/go1.22.7.linux-amd64.tar.gz
sudo tar -xvf go1.22.7.linux-amd64.tar.gz -C /usr/local
export PATH=$PATH:/usr/local/go/bin
go version
- name: Install gosec
run: |
export PATH=$PATH:/usr/local/go/bin
go install github.com/securego/gosec/v2/cmd/gosec@latest
export PATH=$PATH:$(go env GOPATH)/bin
gosec --version
- name: Run gosec security scan
run: |
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s latest
export PATH=$PATH:/usr/local/go/bin:$(go env GOPATH)/bin
gosec -severity high -confidence high ./... || exit 1
- name: e2e test
env:
E2E_TESTING_LEVEL: "periodCheck"
run: make e2e-test
run: make e2e-test
16 changes: 15 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,23 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Remove old Go version
run: sudo rm -rf /usr/local/go
- name: Install Go
run: |
wget https://golang.org/dl/go1.22.7.linux-amd64.tar.gz
sudo tar -xvf go1.22.7.linux-amd64.tar.gz -C /usr/local
export PATH=$PATH:/usr/local/go/bin
go version
- name: Install gosec
run: |
export PATH=$PATH:/usr/local/go/bin
go install github.com/securego/gosec/v2/cmd/gosec@latest
export PATH=$PATH:$(go env GOPATH)/bin
gosec --version
- name: Run gosec security scan
run: |
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s latest
export PATH=$PATH:/usr/local/go/bin:$(go env GOPATH)/bin
gosec -severity high -confidence high ./... || exit 1
- name: pr test
env:
Expand Down

0 comments on commit 0290596

Please sign in to comment.