Compare commits
No commits in common. "c142133a340ca994ffdd02ab455e088a8d33f77f" and "667ccdd9a11897e323221f855f8f9dc26ac50447" have entirely different histories.
c142133a34
...
667ccdd9a1
4 changed files with 1 additions and 44 deletions
|
@ -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 ./...
|
|
|
@ -1,4 +0,0 @@
|
||||||
version: "2"
|
|
||||||
linters:
|
|
||||||
enable:
|
|
||||||
- revive
|
|
|
@ -1,4 +1,3 @@
|
||||||
// Package validation General validation tasks
|
|
||||||
package validation
|
package validation
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -7,7 +6,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidateConventionalCommit validates if string follows conventional commit
|
|
||||||
func ValidateConventionalCommit(commit string) error {
|
func ValidateConventionalCommit(commit string) error {
|
||||||
// Regex to match the commit format
|
// Regex to match the commit format
|
||||||
// type(scope)!: description
|
// type(scope)!: description
|
||||||
|
|
10
main.go
10
main.go
|
@ -1,4 +1,3 @@
|
||||||
// Package main is the main package
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -9,7 +8,6 @@ import (
|
||||||
"git.kjan.de/actions/pull-request-lint/internal/validation"
|
"git.kjan.de/actions/pull-request-lint/internal/validation"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GithubEvent represents a github actions event
|
|
||||||
type GithubEvent struct {
|
type GithubEvent struct {
|
||||||
PullRequest struct {
|
PullRequest struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
|
@ -28,13 +26,7 @@ func main() {
|
||||||
fmt.Printf("Error opening %s: %v\n", eventPath, err)
|
fmt.Printf("Error opening %s: %v\n", eventPath, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer eventFile.Close()
|
||||||
closeFileErr := eventFile.Close()
|
|
||||||
if closeFileErr != nil {
|
|
||||||
fmt.Println("Error closing eventFile")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
var event GithubEvent
|
var event GithubEvent
|
||||||
decoder := json.NewDecoder(eventFile)
|
decoder := json.NewDecoder(eventFile)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue