Skip to content

Secrets

Required and optional secrets for Go Gamma Actions.

Available Secrets

Secret Required Used By Description
CODECOV_TOKEN No test, ci Codecov upload token

CODECOV_TOKEN

What It Does

Authenticates coverage uploads to Codecov.

When Required

  • Required for private repositories
  • Optional for public repositories (but recommended)

How to Get It

  1. Sign up at codecov.io
  2. Add your repository
  3. Go to Settings > General
  4. Copy the Repository Upload Token

How to Configure

Repository Secret

  1. Go to Settings > Secrets and variables > Actions
  2. Click New repository secret
  3. Name: CODECOV_TOKEN
  4. Value: Your token

Organization Secret

For multiple repositories:

  1. Go to organization Settings > Secrets and variables > Actions
  2. Click New organization secret
  3. Name: CODECOV_TOKEN
  4. Value: Your organization token
  5. Select repositories

Usage

jobs:
  ci:
    uses: go-gamma/actions/.github/workflows/ci.yml@v1
    with:
      go-version: '1.24'
      upload-coverage: true
    secrets:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

GITHUB_TOKEN

Automatic

GITHUB_TOKEN is automatically provided by GitHub Actions. You don't need to configure it.

Used for:

  • SARIF upload to Code Scanning
  • Creating GitHub Releases
  • Triggering pkg.go.dev updates

Permissions

Configure via permissions:

permissions:
  contents: write        # For releases
  security-events: write # For SARIF upload

Best Practices

Use Organization Secrets

For consistent configuration across repositories:

secrets:
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Don't Hardcode Tokens

# ❌ Never do this
CODECOV_TOKEN: "abc123..."

# ✅ Always use secrets
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Secret Rotation

Rotate tokens periodically:

  1. Generate new token
  2. Update secret in GitHub
  3. Verify workflows still work