@@ -29,6 +29,7 @@ The Go template uses some global configuration used throughout all jobs.
### build & test jobs
You can specify if you want the template to build an `application` or `modules` with the `GO_BUILD_MODE` variable. It may have the following values:
*`application` will make the build output the binaries (use `-o` build option, won't work if there is no `main.go` file)
*`modules` won't output the binaries (no use of the `-o` option)
*`auto` the template will rely on the presence of a `main.go` file to detect if it should output the binaries.
@@ -165,6 +166,15 @@ It is bound to the `test` stage, and uses the following variables:
| `GO_SBOM_IMAGE` | Image of cyclonedx-gomod used for SBOM analysis | `registry.hub.docker.com/cyclonedx/cyclonedx-gomod:latest` |
| `GO_SBOM_OPTS` | [@cyclonedx/cyclonedx-gomod options](https://github.com/CycloneDX/cyclonedx-gomod#usage) used for SBOM analysis | `-main .` |
:warning: if you don't have your main class located at the root of your `GO_PROJECT_DIR`, then you will need to override the `-main` option in `GO_SBOM_OPTS` and define your real main class location.
Example:
```yaml
variables:
GO_SBOM_OPTS:"-maincmd/my_app"
```
### `go-govulncheck` job
This job enables Vulnerability Management with [Govulncheck](https://go.dev/blog/vuln).