Skip to content

Commit 91c5b82

Browse files
committed
Init
0 parents  commit 91c5b82

File tree

6 files changed

+70
-0
lines changed

6 files changed

+70
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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: ./

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"govulncheck"
4+
]
5+
}

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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"]

action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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"

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/debug-ing/go-vulnerability-checker
2+
3+
go 1.22.3

main.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}

0 commit comments

Comments
 (0)