feat: add go-lint, go-test, commitlint and license-headers composite actions#34
Merged
Conversation
Add three new reusable composite actions for Go projects: - go-lint: runs golangci-lint, go fmt, and go vet with configurable Go version and lint config - go-test: runs go test with race detection, coverage reporting, and JUnit XML output via gotestsum - license-headers: checks/adds SPDX license headers via addlicense with configurable license type, copyright holder, and ignore patterns These actions support the DSX GitHub-First migration and will be reused across event-bus, Carbide, and other DSX Go projects.
9d867cc to
9899c81
Compare
…arsing errors String-based flag expansion caused addlicense to treat -ignore and -check as file path arguments instead of flags. Switch to bash array construction and env vars to preserve flag boundaries correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gofmt -l . scans all .go files including vendor/, which contains third-party code that should not be reformatted. Use find with -not -path './vendor/*' to skip vendor directory. go vet ./... already skips vendor/ by default.
984ab88 to
17604fe
Compare
golangci-lint v2.1 was built with Go 1.24 and fails when targeting Go 1.25 code. v2.9+ added Go 1.25/1.26 support. Bump default to v2.11 (latest stable).
Validates commit messages against conventional commits using commitlint. Supports: - Auto-detection of commitlint config (commitlint.config.js, .commitlintrc.js) - Custom config file path - PR context (lint from base branch) and push context (lint latest commit) - Configurable commit range (from/to refs) Replaces the GitLab .commitlint template from cds/cicd-pipelines.
Contributor
Author
|
/ok to test 9251a3c |
- go-test: route all inputs through env vars to prevent ${{ }} shell
injection, pin gotestsum version, add artifact-name input for matrix
builds, fix go-version-file path for non-root working directories
- go-lint: fix go-version-file path, replace || true with proper error
handling in gofmt check to prevent silent pass on find failures
- license-headers: route addlicense-version through env var, fix success
message to differentiate check vs add mode
- commitlint: add --ignore-scripts to npm install for supply chain
safety, handle HEAD~1 failure on initial commits, support empty
commit range gracefully
Signed-off-by: Hua-Wei Chen <huaweic@nvidia.com>
Add README.md for go-lint, go-test, license-headers, and commitlint actions following existing project conventions. Update main README with new actions in the available actions table, repository structure tree, and documentation links section. Also includes linter-applied SHA pinning for action refs in docs. Signed-off-by: Hua-Wei Chen <huaweic@nvidia.com>
7e2092d to
838b4c3
Compare
mmou-nv
approved these changes
Apr 8, 2026
lachen-nv
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add reusable composite actions and CI workflows for DSX Go and Helm projects:
New Composite Actions (4)
go-lintgo-testlicense-headerscommitlintNew Reusable Workflows (2)
dsx-ci-go.ymldsx-ci-helm.ymlBoth workflows accept an
actions-refinput so callers pin all internal action refs to the same version — no@maindrift.Caller usage (minimal)
Jira: CDEVS-2228
Test plan
🤖 Generated with Claude Code