Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
debug-ing committed Dec 17, 2024
0 parents commit 91c5b82
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/go-vunl-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Go Version Checker Workflow

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check-go-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Run Go Vulnerability Checker
uses: ./
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"govulncheck"
]
}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.23

WORKDIR /app

RUN go install golang.org/x/vuln/cmd/govulncheck@latest

COPY . .

RUN go build -o main main.go

RUN ls -l /app

ENTRYPOINT ["/app/main"]
11 changes: 11 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Go Vulnerability Checker"
description: "Scans Go dependencies for security vulnerabilities using govulncheck"
author: "YourName"

runs:
using: "docker"
image: "Dockerfile"

branding:
icon: "shield"
color: "red"
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/debug-ing/go-vulnerability-checker

go 1.22.3
19 changes: 19 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"fmt"
"os"
"os/exec"
)

func main() {
fmt.Println("Starting Go Dependency Vulnerability Scan...")
cmd := exec.Command("govulncheck", "./...")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Println("Error during vulnerability scan:", err)
os.Exit(1)
}
fmt.Println("Vulnerability scan completed successfully!")
}

0 comments on commit 91c5b82

Please sign in to comment.