Skip to content

Private Modules

Not Required

Go Gamma Actions currently focuses on public dependencies. Private module support is planned for a future release.

Current Status

The workflows are designed for projects with public dependencies. If your project requires private Go modules, you'll need to configure authentication manually.

Workaround

For projects requiring private modules, extend the workflow:

name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-go@v6
        with:
          go-version: '1.24'

      # Configure private module access
      - name: Configure Git for private modules
        run: |
          git config --global url."https://${{ secrets.GH_TOKEN }}@github.com/".insteadOf "https://github.com/"

      - name: Set GOPRIVATE
        run: echo "GOPRIVATE=github.com/your-org/*" >> $GITHUB_ENV

      # Now run your tests
      - run: go test -race ./...

  # Use Gamma Actions for other checks
  lint:
    uses: go-gamma/actions/.github/workflows/lint.yml@v1
    with:
      go-version: '1.24'

Required Secrets

Secret Description
GH_TOKEN GitHub PAT with repo scope for private repos

Future Support

We're planning to add native private module support. Track progress:

Alternatives

Use Go Workspaces

If private modules are local:

my-project/
├── go.work
├── api/
│   └── go.mod
└── private-lib/
    └── go.mod
// go.work
go 1.24

use (
    ./api
    ./private-lib
)

Vendor Dependencies

go mod vendor

Then enable vendor mode (automatic when vendor/ exists).