Configuration¶
Customize Go Gamma Actions for your project's needs.
Go Version¶
Explicit Version¶
From go.mod¶
Automatically detect from your go.mod file:
YAML Parsing
Always quote version numbers! YAML parses 1.24 as 1.2 (float).
Working Directory¶
For projects where Go code isn't in the root:
For monorepos, see the Monorepo Guide.
Testing Options¶
Race Detection¶
Enabled by default. Disable for faster CI on trusted code:
Test Flags¶
Add custom flags to go test:
Coverage Upload¶
Linting Options¶
Only New Issues¶
Report only issues introduced in the PR:
Custom Configuration¶
Use your own .golangci.yml:
Linter Version¶
Security Options¶
SARIF Upload¶
Upload results to GitHub Code Scanning:
Fail on Vulnerabilities¶
Selective Scanning¶
Build Options¶
Platforms¶
Single Platform¶
Upload Artifacts¶
Skip Phases¶
Skip Individual Phases¶
with:
skip-lint: true # Skip linting
skip-security: true # Skip security scan
skip-build: true # Skip build matrix
Use Cases¶
| Scenario | Configuration |
|---|---|
| Library (no binary) | skip-build: true |
| Fast feedback | skip-security: true |
| Draft PR | skip-build: true, skip-security: true |
Full Example¶
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
permissions:
contents: read
security-events: write
jobs:
ci:
uses: go-gamma/actions/.github/workflows/ci.yml@v1
permissions:
contents: read
security-events: write
with:
# Go
go-version: '1.24'
working-directory: '.'
# Testing
race-detection: true
upload-coverage: true
# Linting
only-new-issues: ${{ github.event_name == 'pull_request' }}
# Security
upload-sarif: true
fail-on-vulns: true
# Build
platforms: 'ubuntu-latest,macos-latest,windows-latest'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Next Steps¶
- Inputs Reference - Complete input documentation
- Secrets - Required secrets
- golangci-lint Config - Linter configuration