Skip to content

Commit ccaac40

Browse files
committed
Fix documentation check building every target N times
The yq expression used to read documentation targets from .spi.yml wrapped the config in select(.documentation_targets[] != ""). Because the filter inside select() evaluates .documentation_targets[] as a stream of booleans, select() re-emits the config once per target, and the trailing .documentation_targets[] then multiplies the list to N*N entries. For a package with 17 doc targets this expanded to ~272 targets, so check-docs.sh built every target ~17 times and the job hit its 20 minute timeout (appearing to hang / infinite loop). Move the empty-string guard onto each individual target so every target is emitted exactly once.
1 parent b91213c commit ccaac40

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/scripts/check-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ if ! command -v yq &> /dev/null; then
9494
fi
9595

9696
if [ -z "${docs_targets}" ] ; then
97-
docs_targets=$(yq -r ".builder.configs[] | select(.documentation_targets[] != \"\") | .documentation_targets[]" .spi.yml)
97+
docs_targets=$(yq -r ".builder.configs[].documentation_targets[] | select(. != \"\")" .spi.yml)
9898
fi
9999

100100
package_files=$(find . -maxdepth 1 -name 'Package*.swift')

0 commit comments

Comments
 (0)