Skip to content
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions .github/workflows/context7-refresh.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Context7 serves this repo's docs to coding agents, and re-indexes on its own
# schedule, which can lag a release by weeks. This asks it to re-index when a
# release is published, so agents read the docs for the version users install.
# Context7 takes one refresh per library per 10 days and answers an earlier
# one with HTTP 400 too-early. The daily schedule asks again, so a change that
# lands inside that window is still refreshed within 11 days.
Comment thread
27Bslash6 marked this conversation as resolved.
Outdated
# Scope and agent rules live in context7.json.
# Endpoint: https://context7.com/docs/integrations/github-actions
name: Context7 Refresh

on:
release:
types: [published]
schedule:
- cron: "23 5 * * *"
Comment thread
27Bslash6 marked this conversation as resolved.
workflow_dispatch:

permissions: {}
Expand Down Expand Up @@ -35,5 +40,10 @@ jobs:
case "$status" in
202) echo "::warning::Context7 has not finalized this library yet (HTTP 202). Re-run this workflow later." ;;
2??) echo "Context7 accepted the refresh (HTTP $status)." ;;
400) if jq -e '.error == "too-early"' "$RUNNER_TEMP/context7-response.json" >/dev/null 2>&1; then
echo "::warning::Context7 refreshed this library less than 10 days ago (HTTP 400 too-early). The daily schedule asks again."
else
echo "::error::Context7 refresh failed with HTTP 400."; exit 1
fi ;;
*) echo "::error::Context7 refresh failed with HTTP $status."; exit 1 ;;
esac
Loading