diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 6f1fb9b..64a8437 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -11,13 +11,9 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 - with: - stable: true - go-version: 1.17.x - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.48 + version: latest args: --timeout=5m diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d3e060 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# MacOS +.DS_Store + +# Vagrant +.vagrant*/ + +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool +*.out + +# vendored packages +vendor*/ + +# goreleaser +dist/ + +.envrc \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..9b8602a --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,58 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +project_name: go-trapcheck + +before: + hooks: + - go mod tidy + - golangci-lint run + - cmd: golangci-lint run + env: + - GOOS=linux + - govulncheck ./... + +builds: + - skip: true + +release: + github: + owner: circonus-labs + name: go-trapcheck + + draft: false + prerelease: auto + +changelog: + use: git + sort: desc + abbrev: 0 + groups: + - title: Features + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 1 + - title: 'Dependencies' + regexp: "^.*build(deps):+.*$" + order: 2 + - title: Others + order: 999 + filters: + exclude: + - '^docs:' + - typo + +checksum: + name_template: "{{.ProjectName}}_checksums.txt" + +sboms: + - artifacts: any + args: ["../go.mod", "--output", "cyclonedx-json@1.5={{.ProjectName}}_{{.Version}}.sbom"] + env: + - SYFT_GOLANG_SEARCH_LOCAL_MOD_CACHE_LICENSES=true + - SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true + diff --git a/CHANGELOG.md b/CHANGELOG.md index 8352f2e..7e9b0a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ -# changelog +# unreleased + +## v0.0.14 + +* build: add goreleaser config (with sbom generation) +* chore: use latest lint in workflow +* chore: add .gitignore +* fix: typo in comment + +## v0.0.13 + +* build(deps): bump github.com/hashicorp/go-retryablehttp from 0.7.4 to 0.7.5 ## v0.0.12 diff --git a/broker.go b/broker.go index c5a9c03..3f3f804 100644 --- a/broker.go +++ b/broker.go @@ -56,7 +56,7 @@ func (tc *TrapCheck) fetchBroker(cid, checkType string) error { func (tc *TrapCheck) getBroker(checkType string) error { // - // caller defiened specific broker, try to use it + // caller defined specific broker, try to use it // if tc.checkConfig != nil && len(tc.checkConfig.Brokers) > 0 { return tc.fetchBroker(tc.checkConfig.Brokers[0], checkType)