Files
nanoclaw/.github/workflows/update-tokens.yml
Shawn Yeager d40affbdef fix: skip bump-version and update-tokens on forks
These workflows use APP_ID/APP_PRIVATE_KEY secrets that only exist on
the upstream repo. Without a fork guard they fail on every push for
every fork. merge-forward-skills already has the correct guard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:41:20 +00:00

44 lines
1.3 KiB
YAML

name: Update token count
on:
workflow_dispatch:
push:
branches: [main]
paths: ['src/**', 'container/**', 'launchd/**', 'CLAUDE.md']
jobs:
update-tokens:
if: github.repository == 'qwibitai/nanoclaw'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: ./repo-tokens
id: tokens
with:
include: 'src/**/*.ts container/agent-runner/src/**/*.ts container/Dockerfile container/build.sh launchd/com.nanoclaw.plist CLAUDE.md'
exclude: 'src/**/*.test.ts'
badge-path: 'repo-tokens/badge.svg'
- name: Commit if changed
run: |
git add README.md repo-tokens/badge.svg
git diff --cached --quiet && exit 0
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "docs: update token count to ${{ steps.tokens.outputs.badge }}"
git pull --rebase
git push