Skip to content

Regenerate llms.txt

Regenerate llms.txt #8

name: Regenerate llms.txt
# Refreshes the hand-curated `llms.txt` and `llms-full.txt` at the repo root.
# The generator fetches each page's `.md` from the deployed docs site, so this
# runs after Mintlify has had time to publish — on a schedule, or on demand.
# If anything changed, commits the result straight to main.
#
# Triggers:
# - workflow_dispatch (manual)
# - schedule (weekly, Mondays 07:00 UTC)
on:
workflow_dispatch:
schedule:
- cron: '0 7 * * 1'
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
regenerate:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout docs
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Regenerate llms.txt and llms-full.txt
run: node scripts/generate-llms.mjs
- name: Show diff (for log visibility)
run: git --no-pager diff --stat -- llms.txt llms-full.txt || true
- name: Commit and push to main if changed
run: |
set -euo pipefail
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
if git diff --quiet -- llms.txt llms-full.txt; then
echo 'No changes to llms.txt / llms-full.txt; nothing to commit.'
exit 0
fi
git add llms.txt llms-full.txt
git commit -m 'docs: regenerate llms.txt and llms-full.txt'
# Rebase onto any concurrent pushes before writing back to main.
git pull --rebase --autostash origin main
git push origin HEAD:main