From d6a2f6ffab63cf25ba7c54e4ebc4ea181a69956b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 5 Nov 2026 21:00:48 +0000 Subject: [PATCH] Look up cmd/devpanel-client history with git The commits API returned an empty history for that path. Clone the default branch and use git log to select the commit to build. Co-authored-by: Darren Oh --- .github/workflows/update-devpanel-cli.yml | 29 ++++++++--------------- TODO.md | 9 +++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/update-devpanel-cli.yml b/.github/workflows/update-devpanel-cli.yml index d9c97495..31f18068 100644 --- a/.github/workflows/update-devpanel-cli.yml +++ b/.github/workflows/update-devpanel-cli.yml @@ -42,28 +42,19 @@ jobs: id: upstream env: GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }} + GIT_TERMINAL_PROMPT: "0" run: | set -euo pipefail - body=$(mktemp) - code=$( - curl -sS \ - -H "Authorization: Bearer ${GHCR_TOKEN}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - -o "$body" \ - -w "%{http_code}" \ - "https://api.github.com/repos/devpanel/cli/commits?path=cmd/devpanel-client&per_page=1" \ - || true - ) - if [[ "$code" != "200" ]]; then - echo "::error::Unable to read cmd/devpanel-client history (HTTP ${code:-unknown})." - jq -r '.message // empty' "$body" >&2 || true - exit 1 - fi - sha=$(jq -r '.[0].sha // empty' "$body") - rm -f "$body" + dest="${RUNNER_TEMP}/devpanel-cli-history" + rm -rf "$dest" + git -c "http.extraheader=AUTHORIZATION: bearer ${GHCR_TOKEN}" \ + clone --filter=blob:none --no-checkout \ + https://github.com/devpanel/cli.git "$dest" + sha=$(git -C "$dest" log -1 --format=%H -- cmd/devpanel-client) if [[ ! "$sha" =~ ^[0-9a-f]{40}$ ]]; then - echo "::error::cmd/devpanel-client has no commits on the default branch." + echo "::error::No commit on the default branch changes cmd/devpanel-client." + echo "Entries under cmd/:" >&2 + git -C "$dest" ls-tree --name-only HEAD cmd >&2 || true exit 1 fi echo "sha=${sha}" >> "$GITHUB_OUTPUT" diff --git a/TODO.md b/TODO.md index 34171c0a..09aeb4f7 100644 --- a/TODO.md +++ b/TODO.md @@ -113,3 +113,12 @@ Use this file to track work that needs to be done. Lint scripts automatically ap ## Definition of Done - A cache miss builds both binaries on `ubuntu-26.04` and `ubuntu-26.04-arm` and commits `base/bin/devpanel-amd64` and `base/bin/devpanel-arm64`. + +# Task: Find the latest cmd/devpanel-client commit with git + +## Steps +- [x] Stop using the commits API result that reported no history for that path. +- [x] Read the latest commit that changes `cmd/devpanel-client` from a clone of the default branch. + +## Definition of Done +- The plan job records the commit `git log` reports for `cmd/devpanel-client`.