Files
docs/.github/workflows/refresh-langsmith-openapi.yml

75 lines
2.2 KiB
YAML

---
name: Refresh LangSmith OpenAPI spec
on:
schedule:
# Daily at 10:00 AM UTC
- cron: "0 10 * * *"
workflow_dispatch: {}
jobs:
refresh:
name: Refresh LangSmith Platform API spec
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Python 3.13 + uv
uses: "./.github/actions/uv_setup"
with:
python-version: "3.13"
- name: Fetch and process OpenAPI spec
run: |
uv run python scripts/process_langsmith_openapi.py --write
- name: Create PR with changes
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet src/langsmith/langsmith-platform-openapi.json; then
echo "No changes to commit"
exit 0
fi
BRANCH_NAME="chore/refresh-langsmith-openapi-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH_NAME"
git add src/langsmith/langsmith-platform-openapi.json
git commit -m "$(cat <<'EOF'
chore: refresh LangSmith platform OpenAPI spec
Automated refresh from api.smith.langchain.com with fleet and
internal endpoints filtered for public documentation.
EOF
)"
git push origin "$BRANCH_NAME"
gh pr create \
--title "chore: refresh LangSmith platform OpenAPI spec" \
--body "$(cat <<'EOF'
## Summary
Automated daily refresh of the LangSmith Platform API spec.
## Details
- Fetched latest spec from api.smith.langchain.com
- Applied post-processing: hid fleet/internal endpoints, added human-readable group tags
- Output: `src/langsmith/langsmith-platform-openapi.json`
- Generated by `scripts/process_langsmith_openapi.py`
🤖 This PR was created automatically by GitHub Actions
EOF
)" \
--base main \
--head "$BRANCH_NAME"