Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.25.x"
go-version-file: go.mod

- name: Run tests
run: go test ./internal/...
run: go test ./...

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
version: "v2.10.1"
7 changes: 7 additions & 0 deletions internal/git/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ func CreateArchive(path, remote, branch, gitUserName, gitUserEmail string, w int
return fmt.Errorf("failed to configure git user.name to %q: %w", gitUserName, err)
}

cmd = exec.Command("git", "config", "push.autoSetupRemote", "true")
cmd.Dir = tempRoot
err = cmd.Run()
if err != nil {
return fmt.Errorf("failed to configure git push.autoSetupRemote: %w", err)
}

cmd = exec.Command("git", "checkout", "-b", branch)
cmd.Dir = tempRoot
err = cmd.Run()
Expand Down
7 changes: 7 additions & 0 deletions internal/git/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ func TestCreateArchive(t *testing.T) {
output, err = cmd.Output()
require.NoError(t, err)
require.Equal(t, userEmail, strings.TrimSpace(string(output)))

// Check push.autoSetupRemote
cmd = exec.Command("git", "config", "push.autoSetupRemote")
cmd.Dir = appDir
output, err = cmd.Output()
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(string(output)))
})

t.Run("fails on non-git directory", func(t *testing.T) {
Expand Down