Fix red CI: hermetic git identity in publish test, modernize workflows#12
Merged
Conversation
- Set GIT_AUTHOR_*/GIT_COMMITTER_* env in TestSyncGitRepositoryExistingRepoPreservesRemoteFiles so commits made in syncGitRepository's own clone don't depend on the runner's global git config (Linux runners have no identity -> 'empty ident name' failure). - Drop manual actions/cache step that conflicted with setup-go's built-in cache (hundreds of 'tar: Cannot open: File exists' warnings). - Bump actions to Node 24 versions: checkout@v5, setup-go@v6, golangci-lint-action@v8. - Run go vet and go build before tests so cheap checks always report. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes a Linux CI failure in the publish tests caused by missing git identity on GitHub-hosted runners, and modernizes GitHub Actions workflows to newer major versions while simplifying Go caching.
Changes:
- Make the publish sync test hermetic w.r.t. git identity by setting
GIT_AUTHOR_*/GIT_COMMITTER_*environment variables. - Update workflows to newer action majors (
checkout@v5,setup-go@v6,golangci-lint-action@v8) and remove the redundantactions/cachestep in CI in favor ofsetup-go’s built-in cache. - Reorder CI so
go vet/go buildrun before tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/publish/publish_test.go | Sets git author/committer env vars so commits made from cloned working dirs don’t rely on global git config. |
| .github/workflows/ci.yml | Uses setup-go caching, bumps actions, and reorders checks to run vet/build before tests. |
| .github/workflows/ci-autofix.yml | Bumps checkout/setup-go/golangci-lint-action major versions. |
| .github/workflows/pages.yml | Bumps checkout major version. |
| .github/workflows/release.yml | Bumps checkout/setup-go major versions in release workflows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
git init --bare uses the machine's init.defaultBranch (master on stock CI runners), leaving the bare repo HEAD pointing at a branch that is never pushed; the verify clone then checks out an empty tree. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI on
mainhas been red since the merge of #10 (run 24828582828):TestSyncGitRepositoryExistingRepoPreservesRemoteFilesfails on Linux runners withfatal: empty ident name not allowed. The test configuresuser.name/user.emailonly in the seed repo, butsyncGitRepositorycommits in its own clone directory, relying on a global git identity that CI runners don't have (macOS masks this by deriving identity from the system user, which is why it passes locally).Changes
GIT_AUTHOR_*/GIT_COMMITTER_*env vars in the test (t.Setenv) so identity applies to all git subprocesses regardless of working directory.actions/cachestep in ci.yml — it conflicted with setup-go's built-in cache, producing hundreds oftar: Cannot open: File existswarnings; usesetup-gowithcache: trueinstead.checkout@v5,setup-go@v6,golangci-lint-action@v8(Node 20 deprecation).go vetandgo buildbefore tests, so cheap checks always report even when tests fail.Verification
go test -race ./...green locally in a hermetic env (HOME=$(mktemp -d) GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null).go build ./...,go vet ./...,gofmt -l .clean.🤖 Generated with Claude Code