Skip to content

Commit b249369

Browse files
ci: fix GHCR API endpoint for reading package versions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent 4ebea31 commit b249369

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/check-upstream-release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ jobs:
4242
# Fetch latest upstream version
4343
UPSTREAM_VERSION="${{ steps.upstream.outputs.version }}"
4444
45-
# Query GHCR for existing image tags
46-
# Need package:read permission for this
45+
# Query GHCR for existing image tags - use repo-level packages API
4746
TAGS_RESPONSE=$(curl -s -H "Accept: application/vnd.github+json" \
4847
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
4948
-H "X-GitHub-Api-Version: 2022-11-28" \
50-
"https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${{ github.repository }}/versions")
49+
"https://api.github.com/repos/${{ github.repository }}/packages/container/opencode-server-docker/versions")
50+
51+
echo "GHCR response: $TAGS_RESPONSE"
5152
5253
# Find the latest upstream-* tag
53-
CURRENT_VERSION=$(echo "$TAGS_RESPONSE" | jq -r '.[] | select(.metadata.container.tags[]? | startswith("upstream-")) | .metadata.container.tags[]' 2>/dev/null | head -1 | sed 's/upstream-//')
54+
CURRENT_VERSION=$(echo "$TAGS_RESPONSE" | jq -r '.[] | .metadata.container.tags[]' 2>/dev/null | grep '^upstream-' | head -1 | sed 's/upstream-//')
5455
5556
echo "Current built version: $CURRENT_VERSION"
5657
echo "Latest upstream version: $UPSTREAM_VERSION"

0 commit comments

Comments
 (0)