Skip to content

Commit e76a7e2

Browse files
vdusekclaude
andcommitted
ci: pass bumped version and post-bump ref to docs jobs in release flow
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b6cdc54 commit e76a7e2

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

.github/workflows/manual_release_beta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,7 @@ jobs:
8383
pages: write
8484
id-token: write
8585
uses: ./.github/workflows/manual_release_docs.yaml
86+
with:
87+
# Build docs from the post-bump commit so the rendered version matches the release.
88+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
8689
secrets: inherit

.github/workflows/manual_release_docs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ name: Release docs
33
on:
44
# Runs when manually triggered from the GitHub UI.
55
workflow_dispatch:
6+
inputs:
7+
ref:
8+
description: Git ref to build docs from. Defaults to the workflow's dispatch ref.
9+
required: false
10+
type: string
11+
default: ""
612

713
# Runs when invoked by another workflow.
814
workflow_call:
15+
inputs:
16+
ref:
17+
description: Git ref to build docs from. Defaults to the workflow's dispatch ref.
18+
required: false
19+
type: string
20+
default: ""
921

1022
permissions:
1123
contents: read
@@ -29,6 +41,8 @@ jobs:
2941
- name: Checkout repository
3042
uses: actions/checkout@v6
3143
with:
44+
# Default (empty) falls back to actions/checkout's standard behavior — the ref that triggered the workflow.
45+
ref: ${{ inputs.ref || github.ref }}
3246
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
3347

3448
- name: Set up Node

.github/workflows/manual_release_stable.yaml

Lines changed: 7 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:
@@ -129,4 +133,7 @@ jobs:
129133
pages: write
130134
id-token: write
131135
uses: ./.github/workflows/manual_release_docs.yaml
136+
with:
137+
# Build docs from the post-bump commit so the rendered version matches the release.
138+
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
132139
secrets: inherit

.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. "3.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. When 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)