diff --git a/.gitea/workflows/CI.yml b/.gitea/workflows/CI.yml deleted file mode 100644 index 23d4be6..0000000 --- a/.gitea/workflows/CI.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "Go CI" - -on: - pull_request: - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 1.24.2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v7 - with: - version: v2.0 - - test: - name: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: 1.24.2 - - name: Test - run: go test ./... diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index d5ac850..0000000 --- a/.golangci.yml +++ /dev/null @@ -1,4 +0,0 @@ -version: "2" -linters: - enable: - - revive diff --git a/internal/validation/validation.go b/internal/validation/validation.go index 0a4ada9..8c3123e 100644 --- a/internal/validation/validation.go +++ b/internal/validation/validation.go @@ -1,4 +1,3 @@ -// Package validation General validation tasks package validation import ( @@ -7,7 +6,6 @@ import ( "strings" ) -// ValidateConventionalCommit validates if string follows conventional commit func ValidateConventionalCommit(commit string) error { // Regex to match the commit format // type(scope)!: description diff --git a/main.go b/main.go index 507692b..3a70316 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,3 @@ -// Package main is the main package package main import ( @@ -9,7 +8,6 @@ import ( "git.kjan.de/actions/pull-request-lint/internal/validation" ) -// GithubEvent represents a github actions event type GithubEvent struct { PullRequest struct { Title string `json:"title"` @@ -28,13 +26,7 @@ func main() { fmt.Printf("Error opening %s: %v\n", eventPath, err) os.Exit(1) } - defer func() { - closeFileErr := eventFile.Close() - if closeFileErr != nil { - fmt.Println("Error closing eventFile") - os.Exit(1) - } - }() + defer eventFile.Close() var event GithubEvent decoder := json.NewDecoder(eventFile)