Skip to content

Commit 0775cbe

Browse files
Merge pull request #1376 from gooddata/snapshot-master-1ca56994-to-rel/dev
[bot] Merge master/1ca56994 into rel/dev
2 parents 971f6b1 + 1ca5699 commit 0775cbe

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/netlify-deploy-v2.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ jobs:
124124
restore-keys: hugo-resources-
125125
- name: Build documentation
126126
working-directory: ./docs
127+
env:
128+
HUGO_ENV: production
127129
run: hugo --minify --baseURL https://www.gooddata.com/docs/python-sdk
128130
- name: Publish (draft)
129131
uses: netlify/actions/cli@master

scripts/discover-versions.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ num_versions=${2:-4}
1010

1111
git fetch "$remote_name" 2>/dev/null
1212

13-
# Build a map of section -> branch, keeping only the latest minor per section.
14-
# Associative arrays preserve last-write-wins semantics, matching the original
15-
# generate.sh behavior where later branches overwrite earlier ones.
13+
# Build a map of section -> branch, keeping only the latest patch per section.
14+
# Branches are three-part versions (e.g. rel/1.60.0). We strip the patch to get
15+
# the section (e.g. 1.60), matching the original generate.sh behavior where
16+
# ${target_section%.*} strips the patch component.
1617
declare -A section_map
1718
declare -a section_order
1819

1920
while IFS= read -r vers; do
21+
# Strip patch: 1.60.0 -> 1.60
2022
section="${vers%.*}"
2123
if [ -z "${section_map[$section]+x}" ]; then
2224
section_order+=("$section")
2325
fi
24-
# Later (higher minor) versions overwrite earlier ones for the same major
26+
# Later (higher patch) versions overwrite earlier ones for the same major.minor
2527
section_map["$section"]="rel/$vers"
26-
done < <(git branch -rl "$remote_name/rel/*" | sed 's|.*/rel/||' | grep -E '^[0-9]+\.[0-9]+$' | sort -t. -k1,1n -k2,2n | tail -n"$num_versions")
28+
done < <(git branch -rl "$remote_name/rel/*" | sed 's|.*/rel/||' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n"$num_versions")
2729

2830
# Add dev branch if it exists
2931
if git branch -rl "$remote_name/rel/dev" | grep -q "rel/dev"; then

0 commit comments

Comments
 (0)