Skip to content

Commit 475091c

Browse files
committed
[doc] fix workflow
1 parent ba462e1 commit 475091c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/update-doc-db.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ on:
1010
description: Target python version to generate doc db for
1111
type: string
1212
default: "3.14.3"
13-
ref:
14-
description: Branch to commit to (leave empty for current branch)
13+
base-ref:
14+
description: Base branch to create the update branch from
1515
type: string
16-
default: ""
16+
default: "main"
1717

1818
defaults:
1919
run:
@@ -56,9 +56,12 @@ jobs:
5656
steps:
5757
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v6.0.1
5858
with:
59-
ref: ${{ inputs.ref || github.ref }}
59+
ref: ${{ inputs.base-ref }}
6060
token: ${{ secrets.AUTO_COMMIT_PAT }}
6161

62+
- name: Create update branch
63+
run: git switch -c update-doc-${{ inputs.python-version }}
64+
6265
- name: Download generated doc DBs
6366
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
6467
with:
@@ -96,13 +99,12 @@ jobs:
9699
retention-days: 7
97100
overwrite: true
98101

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

0 commit comments

Comments
 (0)