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
16 changes: 9 additions & 7 deletions .github/workflows/update-doc-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
description: Target python version to generate doc db for
type: string
default: "3.14.3"
ref:
description: Branch to commit to (leave empty for current branch)
base-ref:
description: Base branch to create the update branch from
type: string
default: ""
default: "main"

defaults:
run:
Expand Down Expand Up @@ -56,9 +56,12 @@ jobs:
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v6.0.1
with:
ref: ${{ inputs.ref || github.ref }}
ref: ${{ inputs.base-ref }}
token: ${{ secrets.AUTO_COMMIT_PAT }}

- name: Create update branch
run: git switch -c update-doc-${{ inputs.python-version }}

- name: Download generated doc DBs
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
Expand Down Expand Up @@ -96,13 +99,12 @@ jobs:
retention-days: 7
overwrite: true

- name: Commit and push (non-main branches only)
if: github.ref != 'refs/heads/main' && inputs.ref != 'main'
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if [ -n "$(git status --porcelain)" ]; then
git add crates/doc/src/data.inc.rs
git commit -m "Update doc DB for CPython ${{ inputs.python-version }}"
git push
git push -u origin HEAD
fi
Loading