Skip to content

Commit 787e672

Browse files
authored
Merge pull request #84 from cardmagic/chore/context7-claim
ci: claim the Context7 library and refresh it
2 parents 7e19e64 + 8ef3856 commit 787e672

4 files changed

Lines changed: 54 additions & 2 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Context7 refresh
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "README.md"
9+
- "context7.json"
10+
- "docs/**"
11+
- "examples/**"
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
refresh:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
steps:
21+
- name: Trigger a Context7 refresh
22+
env:
23+
CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }}
24+
LIBRARY_NAME: /${{ github.repository }}
25+
run: |
26+
status=$(curl --silent --show-error --max-time 180 --output response.json --write-out '%{http_code}' \
27+
-X POST https://context7.com/api/v1/refresh \
28+
-H "Content-Type: application/json" \
29+
-H "Authorization: Bearer $CONTEXT7_API_KEY" \
30+
-d "{\"libraryName\": \"$LIBRARY_NAME\"}")
31+
cat response.json
32+
echo
33+
if [ "$status" = "200" ]; then
34+
exit 0
35+
fi
36+
if [ "$status" = "400" ] && grep -q '"error":"too-early"' response.json; then
37+
echo "::notice::Context7 refreshed $LIBRARY_NAME recently, so it skipped this refresh."
38+
exit 0
39+
fi
40+
echo "::error::Context7 refresh failed with HTTP $status."
41+
exit 1

‎AGENTS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ Before you tag, read `docs/virtual-actors.md` and `docs/agents.md` against the
5757
release and correct any requirement, compatibility, or guarantee statement that
5858
changed. After the tag publishes, refresh the solidobjects.dev documentation
5959
snapshot from the tag and redeploy the site; its `check:release` step refuses a
60-
snapshot that is not the latest published tag. Then trigger a Context7 refresh
61-
for this repository.
60+
snapshot that is not the latest published tag. The Context7 refresh workflow
61+
refreshes the index after each push to `main` that changes the documentation.
62+
Confirm that its run succeeded.
6263

6364
## Security & Configuration
6465

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Claim the Context7 library: `context7.json` now carries the library `url` and
6+
the maintainer `public_key`.
7+
- Add the Context7 refresh workflow. A push to `main` that changes the README,
8+
`context7.json`, `docs/`, or `examples/` asks Context7 to refresh the index.
9+
It uses the `CONTEXT7_API_KEY` repository secret.
10+
311
## 0.17.1 - 2026-10-08
412

513
- Name the category in the gem metadata and the README: Solid Objects is a

‎context7.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"$schema": "https://context7.com/schema/context7.json",
3+
"url": "https://context7.com/cardmagic/solid-objects-ruby",
4+
"public_key": "pk_veEo2smPvGYMwP1MncN1A",
35
"projectTitle": "Solid Objects for Rails (solid_objects)",
46
"description": "SQL-backed virtual actor library for Ruby on Rails. Actors have stable identities, durable JSON state in SQLite, PostgreSQL, or MySQL, ordered per-identity mailboxes, fenced activation, durable reminders, and transactional effects. Requires Ruby 3.3+ and Rails 7.1+.",
57
"folders": [

0 commit comments

Comments
 (0)