Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion .github/workflows/test-list-github-models-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [**]
workflow_dispatch:

permissions:
Expand Down
27 changes: 22 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,30 @@ runs:
env:
GH_TOKEN: ${{ inputs.github-token }}
run: |
echo "Fetching GitHub models catalog..."
curl -L \
echo "Fetching GitHub models catalogue..."
HTTP_CODE=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Authorisation: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://models.github.ai/catalog/models \
-o github-models.json
-w "%{http_code}" \
-o github-models.json \
https://models.github.ai/catalog/models)

echo "HTTP Response Code: $HTTP_CODE"

# Check if response is valid
if [ "$HTTP_CODE" != "200" ]; then
echo "Error: API returned HTTP $HTTP_CODE"
cat github-models.json
exit 1
fi

# Validate JSON
if ! jq empty github-models.json 2>/dev/null; then
echo "Error: Response is not valid JSON"
cat github-models.json
exit 1
fi

echo "Models fetched successfully!"
echo "Total models: $(jq length github-models.json)"
Expand Down
Loading