Skip to content

Commit 757a1fe

Browse files
authored
ci: pass bumped version and post-bump ref to docs jobs in release flow (#806)
## Summary The v3.0.0 release versioned the docs as `2.5` instead of `3.0` (overwriting v2.5 content with v3). Root cause: `manual_version_docs.yaml` reads `uv version --short` from a checkout of the workflow's dispatch ref (pre-bump), so the job sees the old version. Run [#26156928273](https://github.com/apify/apify-client-python/actions/runs/26156928273) logged `Version: 2.5.1, Major.Minor: 2.5, Major: 2`; bad output is commit e0a0bc8. ## Fix - `manual_version_docs.yaml` — optional `version_number` input; snapshot step uses it when set, falls back to `uv version --short` for manual dispatch. Companion data-restore PR: #808.
1 parent 0662b4a commit 757a1fe

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/manual_release_stable.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ jobs:
119119
permissions:
120120
contents: write
121121
uses: ./.github/workflows/manual_version_docs.yaml
122+
with:
123+
# Pass the bumped version explicitly — the job's checkout uses the dispatch ref (pre-bump),
124+
# so `uv version --short` from pyproject.toml would return the old version.
125+
version_number: ${{ needs.release_prepare.outputs.version_number }}
122126
secrets: inherit
123127

124128
doc_release:

.github/workflows/manual_version_docs.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ name: Version docs
33
on:
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

1022
concurrency:
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"

0 commit comments

Comments
 (0)