-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.9 KB
/
Copy pathauto-doc.yml
File metadata and controls
64 lines (56 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: auto-doc
on:
pull_request: ~
workflow_dispatch: ~
jobs:
doc:
runs-on: ubuntu-latest
permissions:
contents: read
if: github.event.pull_request.head.repo.fork == false && github.event.pull_request.user.login != 'dependabot[bot]'
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 }}
permission-contents: write
- name: Setup
uses: SAP/ai-sdk-python/.github/actions/setup@main
with:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: true
ref: ${{ github.head_ref }}
index-username: ${{ secrets.ARTIFACTORY_USERNAME }}
index-token: ${{ secrets.ARTIFACTORY_TOKEN }}
- name: Configure git
env:
BOT_EMAIL: ${{ vars.SAP_AI_SDK_BOT_EMAIL }}
BOT_NAME: ${{ vars.SAP_AI_SDK_BOT_NAME }}
run: |
git config --local user.email "$BOT_EMAIL"
git config --local user.name "$BOT_NAME"
- name: Generate docs
run: |
generate_docs() {
(
cd packages/$1/docs
rm -f *.html
uv run python -m pydoc -w ../ || true
)
}
generate_docs base
generate_docs core
generate_docs gen
- name: Commit and push
env:
HEAD_REF: ${{ github.head_ref }}
run: |
git add packages/base/docs packages/core/docs packages/gen/docs
if git diff --cached --quiet; then
echo "No documentation changes to commit"
else
git commit -m "docs: update pydoc3 documentation [skip ci]"
git push origin HEAD:"$HEAD_REF"
fi