Repository navigation
ci(context7): scope the index, add agent rules, refresh on release (LAB-8004) #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1d766f6
ci(context7): scope the index, add agent rules, refresh on release (L…
27Bslash6 6225d28
ci(context7): correct agent rules, warn on HTTP 202 (LAB-8004)
27Bslash6 c10b5c1
docs: zeroize keys in the encryption quick start (LAB-8004)
27Bslash6 0008518
docs(lib): propagate errors in the encryption quick start (LAB-8004)
27Bslash6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # 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. | ||
| # Scope and agent rules live in context7.json. | ||
| # Endpoint: https://context7.com/docs/integrations/github-actions | ||
| name: Context7 Refresh | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| # A release run can publish several releases at once (one per package). Queue | ||
| # them, so at most one refresh is in flight. | ||
| concurrency: | ||
| group: context7-refresh | ||
|
|
||
| jobs: | ||
| refresh: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Ask Context7 to re-index /cachekit-io/cachekit-core | ||
| env: | ||
| CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }} | ||
| run: | | ||
| if [ -z "$CONTEXT7_API_KEY" ]; then | ||
| echo "::error::The CONTEXT7_API_KEY secret is not available to this repository." | ||
| exit 1 | ||
| fi | ||
| status=$(curl -sS --max-time 60 -o "$RUNNER_TEMP/context7-response.json" -w '%{http_code}' \ | ||
| -X POST https://context7.com/api/v1/refresh \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer $CONTEXT7_API_KEY" \ | ||
| --data '{"libraryName": "/cachekit-io/cachekit-core"}') | ||
| cat "$RUNNER_TEMP/context7-response.json" | ||
| echo | ||
| case "$status" in | ||
| 2??) echo "Context7 accepted the refresh (HTTP $status)." ;; | ||
| *) echo "::error::Context7 refresh failed with HTTP $status."; exit 1 ;; | ||
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "$schema": "https://context7.com/schema/context7.json", | ||
| "folders": [], | ||
| "excludeFolders": [".github", "benches", "fuzz", "scripts", "supply-chain", "tests"], | ||
| "excludeFiles": ["CHANGELOG.md"], | ||
| "rules": [ | ||
| "Read the CacheKit master key from the CACHEKIT_MASTER_KEY environment variable or a secret manager. Never hard-code a key in source, not even a placeholder such as [0u8; 32].", | ||
| "`CACHEKIT_MASTER_KEY` holds the key as a hex string. Use exactly 32 bytes (64 hex characters), for example from `openssl rand -hex 32`: it is the only length every CacheKit SDK accepts.", | ||
| "Install the official packages: `cachekit` on PyPI, `@cachekit-io/cachekit` on npm, and `cachekit-rs` on crates.io (imported as `cachekit`). The crates.io crate named `cachekit` is an unrelated project.", | ||
| "The hosted backend is CacheKit Cloud. In code it is named `CachekitIO` (in Python, `CachekitIOBackend`).", | ||
| "Applications normally use a CacheKit SDK. cachekit-core is the shared byte-storage and encryption layer underneath them." | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.