Skip to content

feat(docs): publish YARD API docs + llms.txt to GitHub Pages#480

Merged
gjtorikian merged 4 commits into
mainfrom
feat/api-docs
May 6, 2026
Merged

feat(docs): publish YARD API docs + llms.txt to GitHub Pages#480
gjtorikian merged 4 commits into
mainfrom
feat/api-docs

Conversation

@gjtorikian
Copy link
Copy Markdown
Contributor

@gjtorikian gjtorikian commented May 6, 2026

Summary

  • Adds a YARD-based API reference for the workos gem (HTML + Markdown via yard-markdown), published to GitHub Pages on tag pushes (docs.workos.com/sdk/ruby).
  • Workflow tars docs/_site manually and uploads via actions/upload-artifact named "github-pages" to avoid actions/upload-pages-artifact, which Socket flagged for a ghaArgToSink taint.
  • Adds script/llms-txt to generate an llms.txt index (per llmstxt.org) at the site root, so LLM tooling can locate per-class refs in one fetch.
  • Adds script/docs and script/docs-serve for local builds and previews; ignores docs/_site and .yardoc.

Test plan

  • Run script/docs locally and confirm docs/_site/index.html, per-class .md files, and llms.txt are generated.
  • Run script/docs-serve and confirm the site renders at http://localhost:4000.
  • Trigger the Publish API Docs workflow via workflow_dispatch and verify the build job's github-pages artifact contains the tarred site.
  • Confirm the deploy job succeeds and the published site loads.

Open in Devin Review

gjtorikian added 2 commits May 6, 2026 14:34
Users have no rendered API reference for the workos gem
outside source comments. This wires up YARD (HTML + Markdown
via yard-markdown) and a Pages workflow on tag pushes so
docs.workos.com/sdk/ruby has a stable target.

The workflow tars docs/_site manually instead of using
actions/upload-pages-artifact: Socket flagged that action for
a ghaArgToSink taint and it's trivially replaceable with
upload-artifact named "github-pages", which deploy-pages
consumes unchanged.
The published site is otherwise just HTML and per-class
Markdown; LLM tooling has no entry point that lists the SDK's
surface. script/llms-txt walks the generated markdown and
writes an llms.txt at the site root per the llmstxt.org
convention so models can locate per-class references in a
single fetch.
@gjtorikian gjtorikian requested review from a team as code owners May 6, 2026 21:38
@gjtorikian gjtorikian requested a review from nicknisi May 6, 2026 21:38
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR adds a YARD-based API documentation pipeline — publishing HTML and Markdown docs plus an llms.txt index to GitHub Pages on tag pushes, with local build and preview scripts.

  • Adds .github/workflows/docs.yml to build and deploy the docs site on v* tag pushes or manual dispatch; the deploy job is missing the pages: write and id-token: write permissions that actions/deploy-pages requires, so every deploy will fail until that is fixed.
  • Adds script/docs, script/docs-serve, and script/llms-txt for local doc generation and serving; the scripts correctly scope the docs bundle group and are otherwise well-structured.
  • Adds yard, yard-markdown, and webrick to a new docs Gemfile group so they are not pulled into production or CI non-docs installs.

Confidence Score: 4/5

The workflow will fail on every attempted deploy because the deploy job lacks the permissions that actions/deploy-pages requires.

The build and scripting logic is sound, but the deploy job omits the pages: write and id-token: write permissions that actions/deploy-pages needs to obtain an OIDC token and publish the site. Every tag push or manual dispatch will build successfully then fail at the deploy step, meaning no docs are ever published until this is corrected.

.github/workflows/docs.yml — the deploy job permissions block needs attention.

Important Files Changed

Filename Overview
.github/workflows/docs.yml New CI workflow for publishing YARD docs to GitHub Pages; deploy job is missing the required pages: write and id-token: write permissions, causing it to always fail at the deploy-pages step.
script/docs Build script that installs the docs bundle group and runs YARD twice (HTML then Markdown) before generating llms.txt; logic is correct and intentional per inline comments.
script/llms-txt Ruby script that walks docs/_site for Markdown files, extracts first-level headings, and writes an llms.txt index; logic looks correct.
script/docs-serve Local dev server script; correctly supports both live-reload (YARD server) and static modes.
Gemfile Adds a docs group with yard, yard-markdown, and webrick; properly isolated so they are not installed in non-docs environments.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub (tag push / dispatch)
    participant Build as build job
    participant SA as actions/configure-pages
    participant UA as actions/upload-artifact
    participant Deploy as deploy job
    participant DP as actions/deploy-pages
    participant Pages as GitHub Pages

    GH->>Build: trigger workflow
    Build->>Build: checkout + setup-ruby
    Build->>Build: ./script/docs (yard HTML + MD + llms.txt)
    Build->>SA: configure-pages
    Build->>Build: tar docs/_site to artifact.tar
    Build->>UA: "upload artifact (name=github-pages)"
    UA-->>Build: artifact stored
    Build-->>Deploy: needs: build complete
    Deploy->>DP: deploy-pages (needs pages:write + id-token:write)
    DP->>Pages: publish site
    Pages-->>Deploy: page_url
Loading

Reviews (3): Last reviewed commit: "style(lint): use double quotes inside in..." | Re-trigger Greptile

Comment thread .github/workflows/docs.yml
Comment thread .github/workflows/docs.yml
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

gjtorikian and others added 2 commits May 6, 2026 14:47
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian merged commit 117eeac into main May 6, 2026
7 checks passed
@gjtorikian gjtorikian deleted the feat/api-docs branch May 6, 2026 21:51
Comment on lines +38 to +44
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 The deploy job is missing the pages: write and id-token: write permissions that actions/deploy-pages requires. Without id-token: write the OIDC token is never issued, so the action cannot authenticate with the GitHub Pages deployment API and the job will always fail at the deploy step.

Suggested change
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant