Some checks failed
CI / Test (Go 1.24.x, ubuntu-latest) (push) Successful in 1m53s
CI / Code Quality (push) Failing after 26s
CI / Security Scan (push) Failing after 11s
CI / Test Coverage (push) Successful in 1m13s
CI / Benchmarks (push) Failing after 10m22s
CI / Build CLI (push) Failing after 8s
Benchmarks / Run Benchmarks (push) Failing after 10m13s
Release / Test (push) Successful in 55s
Release / Build (amd64, darwin, ) (push) Failing after 12s
Release / Build (amd64, linux, ) (push) Failing after 6s
Release / Build (amd64, windows, .exe) (push) Failing after 12s
Release / Build (arm64, darwin, ) (push) Failing after 12s
Release / Build (arm64, linux, ) (push) Failing after 12s
Release / Release (push) Has been skipped
CI / Test (Go 1.24.x, macos-latest) (push) Has been cancelled
CI / Test (Go 1.24.x, windows-latest) (push) Has been cancelled
Move hosting from GitHub to private Gitea instance.
2.1 KiB
2.1 KiB
Making This Go Repository Private
Notes on what changes when converting this public GitHub repo to private.
CI/CD - No Changes Required
GitHub Actions workflows continue to work because:
actions/checkout@v4uses the built-inGITHUB_TOKENwhich has access to its own repo- No external private dependencies are required
Local Development
Configure Go for Private Repos
Tell Go to bypass the public module proxy:
go env -w GOPRIVATE=github.com/yourusername/go-jdenticon
Git Authentication
Ensure one of these is configured:
- SSH key linked to your GitHub account
- Personal Access Token (PAT) in git credential helper
~/.netrcfile with GitHub credentials
Using as a Dependency in Other Projects
Any project that imports this module needs:
-
Set
GOPRIVATE:go env -w GOPRIVATE=github.com/yourusername/go-jdenticon -
Configure git authentication (see above)
-
For CI in other repos, add to workflow:
- name: Configure git for private modules run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"(Requires a
GH_PATsecret withreposcope)
What Breaks
| Feature | Status | Notes |
|---|---|---|
| pkg.go.dev documentation | Unavailable | Public proxy can't access private repos |
| "Go Reference" badges | Broken | Remove from README or accept 404 |
| Codecov | May need token | Add CODECOV_TOKEN secret if uploads fail |
Anonymous go get |
Blocked | Users need authentication |
Codecov Fix (If Needed)
If coverage uploads fail after going private:
- Get token from codecov.io for the repo
- Add as repository secret:
CODECOV_TOKEN - Update
.github/workflows/ci.yml:- name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: file: ./coverage.txt token: ${{ secrets.CODECOV_TOKEN }} # Add this line flags: unittests name: codecov-umbrella fail_ci_if_error: false
Reverting to Public
Simply change the repository visibility back to public in GitHub settings. No code changes required.