Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
python-version: ${{ inputs.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 #v8.2.0
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install dependencies
shell: bash
run: uv sync --all-packages --all-extras --locked
96 changes: 96 additions & 0 deletions .github/workflows/api-doc.yml
Comment thread
marikaner marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: api-doc

on:
push:
tags:
- 'gen-v*'
- 'base-v*'
- 'core-v*'
workflow_dispatch: ~

jobs:
doc:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.SAP_AI_SDK_BOT_CLIENT_ID }}
private-key: ${{ secrets.SAP_AI_SDK_BOT_PRIVATE_KEY }}
repositories: |
ai-sdk-python
ai-sdk
permission-contents: write
permission-pull-requests: write

- name: Setup
uses: SAP/ai-sdk-python/.github/actions/setup@main
Comment thread
marikaner marked this conversation as resolved.
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.ref }}
- name: Generate docs
run: uv run make docs

- name: Checkout sap/ai-sdk
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: SAP/ai-sdk
token: ${{ steps.app-token.outputs.token }}
path: ai-sdk
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
persist-credentials: false

- name: Configure git
env:
BOT_EMAIL: ${{ vars.SAP_AI_SDK_BOT_EMAIL }}
BOT_NAME: ${{ vars.SAP_AI_SDK_BOT_NAME }}
run: |
git -C ai-sdk config user.email "$BOT_EMAIL"
git -C ai-sdk config user.name "$BOT_NAME"

- name: Update api docs
id: update-docs
env:
REF: ${{ github.ref_name }}
run: |
BRANCH="api-docs-python-$REF"
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
cd ai-sdk
git checkout -b "$BRANCH"
rm -rf static/api-python
cp -r ../api-docs/ static/api-python
git add static/api-python
if git diff --cached --quiet; then
echo "No documentation changes to commit"
echo "changed=false" >> "$GITHUB_OUTPUT"
else
git commit -m "chore: update Python API docs ($REF)"
git push --force origin "$BRANCH"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Create pull request
if: steps.update-docs.outputs.changed == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REF: ${{ github.ref_name }}
BRANCH: ${{ steps.update-docs.outputs.branch }}
run: |
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
REF_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$REF"
else
REF_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$REF"
fi
if gh pr list --repo SAP/ai-sdk --head "$BRANCH" --json number --jq '.[0].number' | grep -q .; then
echo "Pull request already exists for branch $BRANCH"
else
gh pr create \
--repo SAP/ai-sdk \
--base main \
--head "$BRANCH" \
--title "chore: update Python API docs ($REF)" \
--body "Automated update of Python API docs from [$REF]($REF_URL) in SAP/ai-sdk-python."
fi
62 changes: 0 additions & 62 deletions .github/workflows/auto-doc.yml

This file was deleted.

131 changes: 0 additions & 131 deletions packages/base/docs/ai_api_client_sdk.ai_api_v2_client.html

This file was deleted.

Loading
Loading