-
Notifications
You must be signed in to change notification settings - Fork 2
Add a curated llms.txt generated from the docs.json nav #47
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
base: main
Are you sure you want to change the base?
Changes from all commits
40f46b4
4855fa8
a4f7299
73d2fed
4e1a1f4
36b60a8
49cc60c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Check llms.txt is current | ||
|
|
||
| # llms.txt is generated from the docs.json nav by scripts/generate-llms-txt.sh | ||
| # and committed, because Mintlify serves it from the repo rather than building | ||
| # it. Fail PRs where the committed file no longer matches what the generator | ||
| # produces — otherwise adding a page silently leaves it out of the index. | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| # '**.mdx', not '**/*.mdx' — '**' matches any character including '/', | ||
| # so the '/' in '**/*.mdx' is literal and the root-level nav pages | ||
| # (index.mdx, flox-5-minutes.mdx) would not match. Both feed llms.txt. | ||
| - '**.mdx' | ||
| - 'docs.json' | ||
| - 'llms.txt' | ||
| - 'llms.txt.header' | ||
| - 'scripts/generate-llms-txt.sh' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| check-llms-txt: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout docs | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
|
|
||
| - name: Regenerate llms.txt | ||
| run: ./scripts/generate-llms-txt.sh | ||
|
|
||
| # Stage before diffing, and diff the index. A PR that DELETES llms.txt | ||
| # would otherwise pass: the step above recreates the file as untracked, | ||
| # and `git diff` cannot see untracked files, so the drift comes back | ||
| # empty and the one outcome this workflow exists to prevent — handing | ||
| # /docs/llms.txt back to Mintlify's generated version — merges green. | ||
| - name: Check for drift | ||
| run: | | ||
| git add llms.txt | ||
| if ! git diff --cached --exit-code --stat llms.txt; then | ||
| echo "::error::llms.txt is out of date. Run ./scripts/generate-llms-txt.sh and commit the result." | ||
| git diff --cached llms.txt | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,19 +30,29 @@ jobs: | |
| run: | | ||
| flox activate -- ./scripts/sync-man-pages.sh "$GITHUB_WORKSPACE/flox-src" ./man | ||
|
|
||
| # llms.txt takes each man page's description from its `## NAME` line, so | ||
| # a reworded NAME upstream puts the committed file out of date. Regenerate | ||
| # here rather than let check-llms-txt.yml fail this PR: the job that | ||
| # causes the drift is the one that can fix it without a human. | ||
| # Deliberately outside `flox activate` — this environment ships node, | ||
| # vale and pandoc, and the generator needs python3 from the runner. | ||
| - name: Regenerate llms.txt | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blocking: The next time a command is retired upstream, the daily man-page sync will stop producing PRs altogether instead of surfacing the retirement. Suggested: add (Peer panel: all four seats converged; the strongest finding on the panel.) |
||
| run: ./scripts/generate-llms-txt.sh | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8 | ||
| with: | ||
| token: "${{ secrets.MANAGED_FLOXBOT_GITHUB_ACCESS_TOKEN_REPO_SCOPE }}" | ||
| add-paths: | | ||
| man | ||
| llms.txt | ||
| commit-message: "chore(man): sync man pages from flox/flox" | ||
| committer: "FloxBot <bot@flox.dev>" | ||
| author: "FloxBot <bot@flox.dev>" | ||
| branch: "chore-sync-man-pages" | ||
| delete-branch: true | ||
| title: "chore(man): sync man pages from flox/flox" | ||
| body: "This PR was automatically created by the [Sync man pages workflow](https://github.com/flox/docs/actions/workflows/sync-man-pages.yml). `man/*.mdx` is generated from flox/flox `cli/flox/doc` — please spot-check the rendered pages before merging." | ||
| body: "This PR was automatically created by the [Sync man pages workflow](https://github.com/flox/docs/actions/workflows/sync-man-pages.yml). `man/*.mdx` is generated from flox/flox `cli/flox/doc` — please spot-check the rendered pages before merging. `llms.txt` is regenerated in the same job, so any change to it here follows from an added, removed, renamed or reworded man page — spot-check it alongside the pages themselves." | ||
| # Routing is via the label, matching the sibling | ||
| # update-flox-version.yml workflow. | ||
| labels: "team-developer-support" | ||
Uh oh!
There was an error while loading. Please reload this page.