File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,10 @@ jobs:
130130 permissions :
131131 contents : write
132132 uses : ./.github/workflows/manual_version_docs.yaml
133+ with :
134+ # Pass the bumped version explicitly — the job's checkout uses the dispatch ref (pre-bump),
135+ # so `uv version --short` from pyproject.toml would return the old version.
136+ version_number : ${{ needs.release_prepare.outputs.version_number }}
133137 secrets : inherit
134138
135139 doc_release :
Original file line number Diff line number Diff line change @@ -3,9 +3,21 @@ name: Version docs
33on :
44 # Runs when manually triggered from the GitHub UI.
55 workflow_dispatch :
6+ inputs :
7+ version_number :
8+ description : Version to snapshot (e.g. "1.0.0"). If empty, the current version in pyproject.toml is used.
9+ required : false
10+ type : string
11+ default : " "
612
713 # Runs when invoked by another workflow.
814 workflow_call :
15+ inputs :
16+ version_number :
17+ description : Version to snapshot (e.g. "1.0.0"). If empty, the current version in pyproject.toml is used.
18+ required : false
19+ type : string
20+ default : " "
921
1022concurrency :
1123 group : version-docs
@@ -56,11 +68,19 @@ jobs:
5668
5769 - name : Snapshot the current version
5870 id : snapshot
71+ env :
72+ INPUT_VERSION : ${{ inputs.version_number }}
5973 run : |
6074 cd website
6175
62- # Extract version from pyproject.toml.
63- FULL_VERSION="$(uv version --short)"
76+ # Prefer the explicit input (passed by the release workflow after the version bump).
77+ # Fall back to pyproject.toml only when run manually without an input — this avoids
78+ # the stale-checkout pitfall where the bumped version isn't visible to this job.
79+ if [[ -n "$INPUT_VERSION" ]]; then
80+ FULL_VERSION="$INPUT_VERSION"
81+ else
82+ FULL_VERSION="$(uv version --short)"
83+ fi
6484 MAJOR_MINOR_VERSION="$(echo "$FULL_VERSION" | cut -d. -f1-2)"
6585 MAJOR_VERSION="$(echo "$FULL_VERSION" | cut -d. -f1)"
6686 echo "version=$FULL_VERSION" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments