File tree Expand file tree Collapse file tree 6 files changed +70
-0
lines changed
Expand file tree Collapse file tree 6 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Go Version Checker Workflow
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ branches :
9+ - master
10+
11+ jobs :
12+ check-go-version :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v3
17+
18+ - name : Run Go Vulnerability Checker
19+ uses : ./
Original file line number Diff line number Diff line change 1+ {
2+ "cSpell.words" : [
3+ " govulncheck"
4+ ]
5+ }
Original file line number Diff line number Diff line change 1+ FROM golang:1.23
2+
3+ WORKDIR /app
4+
5+ RUN go install golang.org/x/vuln/cmd/govulncheck@latest
6+
7+ COPY . .
8+
9+ RUN go build -o main main.go
10+
11+ RUN ls -l /app
12+
13+ ENTRYPOINT ["/app/main" ]
Original file line number Diff line number Diff line change 1+ name : " Go Vulnerability Checker"
2+ description : " Scans Go dependencies for security vulnerabilities using govulncheck"
3+ author : " YourName"
4+
5+ runs :
6+ using : " docker"
7+ image : " Dockerfile"
8+
9+ branding :
10+ icon : " shield"
11+ color : " red"
Original file line number Diff line number Diff line change 1+ module github.com/debug-ing/go-vulnerability-checker
2+
3+ go 1.22.3
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "fmt"
5+ "os"
6+ "os/exec"
7+ )
8+
9+ func main () {
10+ fmt .Println ("Starting Go Dependency Vulnerability Scan..." )
11+ cmd := exec .Command ("govulncheck" , "./..." )
12+ cmd .Stdout = os .Stdout
13+ cmd .Stderr = os .Stderr
14+ if err := cmd .Run (); err != nil {
15+ fmt .Println ("Error during vulnerability scan:" , err )
16+ os .Exit (1 )
17+ }
18+ fmt .Println ("Vulnerability scan completed successfully!" )
19+ }
You can’t perform that action at this time.
0 commit comments