Skip to content

Commit 60a8023

Browse files
vdusekclaude
andcommitted
refactor: Use more precise variable names for version identifiers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5234705 commit 60a8023

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/manual_version_docs.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,34 +84,34 @@ jobs:
8484
yarn install
8585
8686
# Extract version from pyproject.toml.
87-
VERSION="$(uv version --short)"
88-
MAJOR_MINOR="$(echo "$VERSION" | cut -d. -f1-2)"
89-
MAJOR="$(echo "$VERSION" | cut -d. -f1)"
90-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
91-
echo "Version: $VERSION, Major.Minor: $MAJOR_MINOR, Major: $MAJOR"
87+
FULL_VERSION="$(uv version --short)"
88+
MAJOR_MINOR_VERSION="$(echo "$FULL_VERSION" | cut -d. -f1-2)"
89+
MAJOR_VERSION="$(echo "$FULL_VERSION" | cut -d. -f1)"
90+
echo "version=$FULL_VERSION" >> "$GITHUB_OUTPUT"
91+
echo "Version: $FULL_VERSION, Major.Minor: $MAJOR_MINOR_VERSION, Major: $MAJOR_VERSION"
9292
9393
# Find the existing version for this major in versions.json (if any).
9494
if [[ -f versions.json ]]; then
95-
OLD_VERSION="$(jq -r --arg major "$MAJOR" '.[] | select(startswith($major + "."))' versions.json | head -1)"
95+
OLD_VERSION="$(jq -r --arg major "$MAJOR_VERSION" '.[] | select(startswith($major + "."))' versions.json | head -1)"
9696
else
9797
OLD_VERSION=""
9898
echo "[]" > versions.json
9999
fi
100100
101101
# Remove only the specific old version for this major (if found).
102102
if [[ -n "$OLD_VERSION" ]]; then
103-
echo "Removing old version $OLD_VERSION for major $MAJOR"
103+
echo "Removing old version $OLD_VERSION for major $MAJOR_VERSION"
104104
rm -rf "versioned_docs/version-${OLD_VERSION}"
105105
rm -f "versioned_sidebars/version-${OLD_VERSION}-sidebars.json"
106106
jq --arg old "$OLD_VERSION" '[.[] | select(. != $old)]' versions.json > tmp.json && mv tmp.json versions.json
107107
else
108-
echo "No existing version found for major $MAJOR, nothing to remove"
108+
echo "No existing version found for major $MAJOR_VERSION, nothing to remove"
109109
fi
110110
111111
# Build API reference and create Docusaurus version snapshots.
112112
bash build_api_reference.sh
113-
uv run npx docusaurus docs:version "$MAJOR_MINOR"
114-
uv run npx docusaurus api:version "$MAJOR_MINOR"
113+
uv run npx docusaurus docs:version "$MAJOR_MINOR_VERSION"
114+
uv run npx docusaurus api:version "$MAJOR_MINOR_VERSION"
115115
116116
- name: Commit and push versioned docs
117117
id: commit_versioned_docs

0 commit comments

Comments
 (0)