Skip to content
Closed
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
20 changes: 13 additions & 7 deletions .github/workflows/api-docs-backfill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

name: "API Reference Backfill"
on:
# TEMP (do not merge): lets a draft PR trigger this workflow for a real run.
# On pull_request there are no dispatch inputs, so the steps below fall back
# to llamaindex/v0.7.0 via `inputs.x || 'default'`.
pull_request:
workflow_dispatch:
inputs:
package:
Expand Down Expand Up @@ -50,15 +54,17 @@ jobs:
- name: Checkout main (current layout + scripts)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
ref: main
# TEMP: head_ref so the pre-merge test sees docs-site/scripts (not yet
# on main); falls back to main for real workflow_dispatch runs.
ref: ${{ github.head_ref || 'main' }}
submodules: recursive

# Map the URL slug to its package directory (the slug is not the directory
# name).
- name: Resolve package directory
id: resolve
env:
PKG: ${{ inputs.package }}
PKG: ${{ inputs.package || 'llamaindex' }}
run: |
case "$PKG" in
core) echo "dir=packages/toolbox-core" >> "$GITHUB_OUTPUT" ;;
Expand All @@ -71,7 +77,7 @@ jobs:
- name: Checkout tagged package source
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
ref: refs/tags/toolbox-${{ inputs.package }}-${{ inputs.version }}
ref: refs/tags/toolbox-${{ inputs.package || 'llamaindex' }}-${{ inputs.version || 'v0.7.0' }}
path: tagged_src
sparse-checkout: ${{ steps.resolve.outputs.dir }}

Expand Down Expand Up @@ -114,8 +120,8 @@ jobs:

- name: Build docs
env:
PKG: ${{ inputs.package }}
VER: ${{ inputs.version }}
PKG: ${{ inputs.package || 'llamaindex' }}
VER: ${{ inputs.version || 'v0.7.0' }}
# Deploys only run upstream (see job-level guard), so always use the
# production domain.
BASE_URL: https://py.mcp-toolbox.dev/
Expand All @@ -130,8 +136,8 @@ jobs:
- name: Open PR against gh-pages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PKG: ${{ inputs.package }}
VER: ${{ inputs.version }}
PKG: ${{ inputs.package || 'llamaindex' }}
VER: ${{ inputs.version || 'v0.7.0' }}
run: |
set -euo pipefail
BRANCH="backfill/${PKG}-${VER}"
Expand Down