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
29 changes: 10 additions & 19 deletions .github/workflows/update-devpanel-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Loading