Refresh LangSmith OpenAPI spec #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Refresh LangSmith OpenAPI spec | |
| on: | |
| schedule: | |
| # Weekly on Monday at 10:00 AM UTC | |
| - cron: "0 10 * * 1" | |
| 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 weekly 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" |