Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.
Closed
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
25 changes: 20 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,28 @@ 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 JSON or the expected "OK" response
if [ "$(cat github-models.json)" = "OK" ]; then
echo "Success: API returned OK"
exit 0
fi

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