From c064bc2a68d0a4c7d615c3f74abb858ad0692feb Mon Sep 17 00:00:00 2001 From: digitallysavvy Date: Tue, 19 May 2026 17:04:09 -0400 Subject: [PATCH 01/22] fix quickstart git clone credential handling Disable git credential helpers for quickstart clone subprocesses so init and quickstart create work in non-interactive agent and CI environments. --- internal/cli/quickstart.go | 18 +++++++++++------ internal/cli/quickstart_test.go | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 internal/cli/quickstart_test.go diff --git a/internal/cli/quickstart.go b/internal/cli/quickstart.go index 49d03ff..547edc4 100644 --- a/internal/cli/quickstart.go +++ b/internal/cli/quickstart.go @@ -410,12 +410,7 @@ func (a *App) quickstartRepoURL(template quickstartTemplate) string { } func cloneQuickstartRepo(repoURL, targetDir, ref string) error { - args := []string{"clone", "--depth", "1"} - if strings.TrimSpace(ref) != "" { - args = append(args, "--branch", strings.TrimSpace(ref)) - } - args = append(args, repoURL, targetDir) - cmd := exec.Command("git", args...) + cmd := exec.Command("git", gitQuickstartCloneArgs(repoURL, targetDir, ref)...) output, err := cmd.CombinedOutput() if err != nil { trimmed := strings.TrimSpace(string(output)) @@ -428,6 +423,17 @@ func cloneQuickstartRepo(repoURL, targetDir, ref string) error { return nil } +func gitQuickstartCloneArgs(repoURL, targetDir, ref string) []string { + // Disable credential helpers for this invocation so non-TTY agent/CI runs + // do not consult macOS keychain for public HTTPS repos. + args := []string{"-c", "credential.helper=", "clone", "--depth", "1"} + if strings.TrimSpace(ref) != "" { + args = append(args, "--branch", strings.TrimSpace(ref)) + } + args = append(args, repoURL, targetDir) + return args +} + func (a *App) resolveOptionalProjectTarget(explicitProject, startPath string) (projectTarget, bool, error) { if strings.TrimSpace(explicitProject) != "" { target, err := a.resolveProjectTargetFrom(explicitProject, startPath) diff --git a/internal/cli/quickstart_test.go b/internal/cli/quickstart_test.go new file mode 100644 index 0000000..0172e47 --- /dev/null +++ b/internal/cli/quickstart_test.go @@ -0,0 +1,36 @@ +package cli + +import ( + "os" + "path/filepath" + "reflect" + "testing" +) + +func TestGitQuickstartCloneArgs(t *testing.T) { + args := gitQuickstartCloneArgs("https://github.com/AgoraIO/example", "/tmp/example", "") + want := []string{"-c", "credential.helper=", "clone", "--depth", "1", "https://github.com/AgoraIO/example", "/tmp/example"} + if !reflect.DeepEqual(args, want) { + t.Fatalf("unexpected clone args:\n got: %#v\nwant: %#v", args, want) + } + + args = gitQuickstartCloneArgs("https://github.com/AgoraIO/example", "/tmp/example", " release/v1 ") + want = []string{"-c", "credential.helper=", "clone", "--depth", "1", "--branch", "release/v1", "https://github.com/AgoraIO/example", "/tmp/example"} + if !reflect.DeepEqual(args, want) { + t.Fatalf("unexpected clone args with ref:\n got: %#v\nwant: %#v", args, want) + } +} + +func TestCloneQuickstartRepoLocal(t *testing.T) { + repo := createLocalGitRepo(t, map[string]string{ + "README.md": "# Quickstart\n", + }) + target := filepath.Join(t.TempDir(), "quickstart") + + if err := cloneQuickstartRepo(repo, target, ""); err != nil { + t.Fatalf("cloneQuickstartRepo failed: %v", err) + } + if _, err := os.Stat(filepath.Join(target, ".git")); err != nil { + t.Fatalf("expected cloned git repo: %v", err) + } +} From 257cf26c7008f3255b73108fadc99b5ee725e0ad Mon Sep 17 00:00:00 2001 From: digitallysavvy Date: Tue, 19 May 2026 17:05:00 -0400 Subject: [PATCH 02/22] chore: bump GitHub Actions versions in workflows Update checkout, deploy-pages, Docker setup, and setup-node actions to their latest major releases across CI, release, pages, and govulncheck workflows. --- .github/workflows/apt-repo.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/govulncheck.yml | 2 +- .github/workflows/pages.yml | 4 ++-- .github/workflows/release.yml | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/apt-repo.yml b/.github/workflows/apt-repo.yml index 342c787..07144d8 100644 --- a/.github/workflows/apt-repo.yml +++ b/.github/workflows/apt-repo.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install apt tools run: sudo apt-get install -y --no-install-recommends dpkg-dev apt-utils diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d6eda7..f8fd6c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v5 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 925cea5..a029bc2 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v5 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2007bd1..c1798b1 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v5 @@ -70,5 +70,5 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95a1ef7..74db9f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # GoReleaser needs full history for changelog @@ -57,13 +57,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.actor }} @@ -107,10 +107,10 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: "20" registry-url: "https://registry.npmjs.org" From 2e55c8eed141b0b773b52f03fa9719f5499530b6 Mon Sep 17 00:00:00 2001 From: digitallysavvy Date: Tue, 19 May 2026 17:07:32 -0400 Subject: [PATCH 03/22] chore: release v0.2.1 Prepare the 0.2.1 patch release in the changelog and version metadata. --- CHANGELOG.md | 9 ++++++++- internal/cli/version.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a9258..82a4cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ Earlier entries pre-date this convention and only carry their version's compare ## [Unreleased] +## [0.2.1] - 2026-05-19 + +### Fixed + +- Disable git credential helpers for quickstart clone subprocesses so `agora init` and `agora quickstart create` succeed in non-interactive agent and CI environments without macOS keychain access. + ## [0.2.0] - 2026-05-05 ### Added @@ -199,7 +205,8 @@ Earlier entries pre-date this convention and only carry their version's compare - Support machine-readable JSON output for automation and agent workflows. - Ship automated release packaging through GoReleaser, including cross-platform archives, Linux packages, Homebrew, Scoop, npm wrapper packages, Docker images, and install scripts. -[Unreleased]: https://github.com/AgoraIO/cli/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/AgoraIO/cli/compare/v0.2.1...HEAD +[0.2.1]: https://github.com/AgoraIO/cli/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/AgoraIO/cli/compare/v0.1.9...v0.2.0 [0.1.9]: https://github.com/AgoraIO/cli/compare/v0.1.8...v0.1.9 [0.1.8]: https://github.com/AgoraIO/cli/compare/v0.1.7...v0.1.8 diff --git a/internal/cli/version.go b/internal/cli/version.go index b87865e..fb2da83 100644 --- a/internal/cli/version.go +++ b/internal/cli/version.go @@ -5,7 +5,7 @@ import "fmt" // Build-time injected version variables. These are populated by ldflags at // release time: // -// go build -ldflags '-X github.com/.../internal/cli.version=v0.2.0 +// go build -ldflags '-X github.com/.../internal/cli.version=v0.2.1 // -X github.com/.../internal/cli.commit=abc1234 // -X github.com/.../internal/cli.date=2026-05-05' // From ad8135df56ada88e03c0f3b35ef504cc81bf02a0 Mon Sep 17 00:00:00 2001 From: digitallysavvy Date: Tue, 19 May 2026 17:24:57 -0400 Subject: [PATCH 04/22] fix: harden quickstart clone with friendly errors and override visibility Validate --ref and AGORA_QUICKSTART_