File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,12 @@ jobs:
161161
162162 - name : Run Gosec Security Scanner
163163 run : |
164- go install github.com/securecodewarrior/gosec/v2/cmd/gosec@latest
165- gosec -fmt json -out gosec-report.json ./...
164+ # 下载并安装 gosec 二进制文件
165+ GOSEC_VERSION=$(curl -s "https://api.github.com/repos/securecodewarrior/gosec/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
166+ wget "https://github.com/securecodewarrior/gosec/releases/download/${GOSEC_VERSION}/gosec_${GOSEC_VERSION#v}_linux_amd64.tar.gz"
167+ tar -xzf "gosec_${GOSEC_VERSION#v}_linux_amd64.tar.gz"
168+ chmod +x gosec
169+ ./gosec -fmt json -out gosec-report.json ./...
166170
167171 - name : Upload Gosec report
168172 uses : actions/upload-artifact@v4
You can’t perform that action at this time.
0 commit comments