Skip to content
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
62 changes: 62 additions & 0 deletions .github/workflows/registry-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Registry check

on:
schedule:
- cron: '0 12 * * 1'
workflow_dispatch:

permissions:
contents: read
issues: write

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- run: npm run build -w @tokenometer/core
- id: check
run: |
set +e
OUTPUT=$(npm run --silent check:overrides -w @tokenometer/core 2>&1)
STATUS=$?
{
echo 'output<<EOF'
echo "$OUTPUT"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
echo "status=$STATUS" >> "$GITHUB_OUTPUT"
echo "$OUTPUT"
exit 0
- name: Open or update tracking issue on findings
if: steps.check.outputs.status != '0'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BODY: |
The weekly tokenlens registry check found findings.

```
${{ steps.check.outputs.output }}
```

Resolve by either:
- Deleting the listed `LOCAL_OVERRIDES` entries in `packages/core/src/rates.ts`, or
- Reviewing upstream pricing/context drift and refreshing the snapshot via
`npm run snapshot:registry -w @tokenometer/core`.
run: |
TITLE='[registry-check] tokenlens upstream changes detected'
EXISTING=$(gh issue list --search "$TITLE in:title is:open" --json number --jq '.[0].number')
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --body "$BODY"
else
gh issue create --title "$TITLE" --body "$BODY" --label registry-check
fi
- name: Fail job if findings present
if: steps.check.outputs.status != '0'
run: exit 1
Loading
Loading