File: content/manuals/scout/integrations/environment/cli.md
Issue
The GitLab example has confusing conditional logic:
- |
if [[ -z "$CI_COMMIT_TAG" ]]; then
tag="latest"
echo "Running tag '$CI_COMMIT_TAG'"
else
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH'"
fi
When CI_COMMIT_TAG is empty (building a branch), it sets tag="latest" but echoes "Running tag '$CI_COMMIT_TAG'" (which is empty). When CI_COMMIT_TAG is NOT empty (building a tag), it sets tag="$CI_COMMIT_REF_SLUG" (which could be a branch or tag slug) and says "Running on branch".
The logic appears to conflate tags and branches, and the echo statements don't match what's actually happening.
Why this matters
A reader following this example would see:
- Misleading echo output that doesn't match the actual values being used
- Unclear logic about when to use "latest" vs the ref slug
- Confusion about whether CI_COMMIT_REF_SLUG represents a tag or branch in the else case
Suggested fix
Clarify the logic to match the echo statements:
- |
if [[ -z "$CI_COMMIT_TAG" ]]; then
tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH'"
else
tag="$CI_COMMIT_TAG"
echo "Running tag '$CI_COMMIT_TAG'"
fi
echo "tag = $tag"
Or, if the intent is to use "latest" for branches:
- |
if [[ -z "$CI_COMMIT_TAG" ]]; then
tag="latest"
echo "Running on branch '$CI_COMMIT_BRANCH'"
else
tag="$CI_COMMIT_TAG"
echo "Running tag '$CI_COMMIT_TAG'"
fi
echo "tag = $tag"
Found by nightly documentation quality scanner
File:
content/manuals/scout/integrations/environment/cli.mdIssue
The GitLab example has confusing conditional logic:
When
CI_COMMIT_TAGis empty (building a branch), it setstag="latest"but echoes "Running tag '$CI_COMMIT_TAG'" (which is empty). WhenCI_COMMIT_TAGis NOT empty (building a tag), it setstag="$CI_COMMIT_REF_SLUG"(which could be a branch or tag slug) and says "Running on branch".The logic appears to conflate tags and branches, and the echo statements don't match what's actually happening.
Why this matters
A reader following this example would see:
Suggested fix
Clarify the logic to match the echo statements:
Or, if the intent is to use "latest" for branches:
Found by nightly documentation quality scanner