Skip to content

Commit 8bfbe7b

Browse files
yomybabyclaude
andauthored
fix(FR-3255): derive Amplify archive-branch fetch list from docs config (#8158)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 60cc64d commit 8bfbe7b

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

amplify.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,27 @@ applications:
156156
# `<projectRoot>/.docs-archive/<sanitized-ref>`. With the
157157
# appRoot set to this package, `<projectRoot>` IS the cwd,
158158
# so the worktree path is simply
159-
# `.docs-archive/<sanitized-ref>`. The list is hardcoded
160-
# to `26.4` for v1; future archived minors must be added
161-
# here in lockstep with the `versions:` config until a
162-
# toolkit helper does it dynamically.
159+
# `.docs-archive/<sanitized-ref>`.
160+
#
161+
# ARCHIVE_REFS is derived DIRECTLY from the config's
162+
# `versions:` block (FR-3255) — every `ref: docs-archive/X.Y`
163+
# line — so adding a minor to `docs-toolkit.config.yaml`
164+
# (which the `docs-version-pdftag-pr.yml` release automation
165+
# now does automatically) is picked up here with ZERO
166+
# lockstep edits. The `^\s*ref:` anchor matches only real
167+
# archive-branch refs, never the `docs-archive/…` mentions
168+
# in the surrounding config comments. The
169+
# `${ARR[@]+"${ARR[@]}"}` expansion is empty-array-safe under
170+
# `set -u` (older bash errors on a bare `"${ARR[@]}"`).
163171
- |
164172
set -euo pipefail
165-
ARCHIVE_REFS=(docs-archive/26.4)
166-
for ref in "${ARCHIVE_REFS[@]}"; do
173+
mapfile -t ARCHIVE_REFS < <(
174+
grep -oE '^[[:space:]]*ref:[[:space:]]*docs-archive/[0-9]+\.[0-9]+[[:space:]]*$' \
175+
docs-toolkit.config.yaml \
176+
| grep -oE 'docs-archive/[0-9]+\.[0-9]+' | sort -u
177+
)
178+
echo "Archive refs from config: ${ARCHIVE_REFS[*]:-(none)}"
179+
for ref in ${ARCHIVE_REFS[@]+"${ARCHIVE_REFS[@]}"}; do
167180
sanitized="${ref//\//__}"
168181
worktree=".docs-archive/${sanitized}"
169182
# Idempotency check: a plain `[ -d "${worktree}" ]` is

0 commit comments

Comments
 (0)