File: content/manuals/scout/integrations/environment/cli.md
Issue
The Circle CI example has inverted conditional logic that would cause it to use the wrong variable:
- run: |
if [[ -z "$CIRCLE_TAG" ]]; then
tag="$CIRCLE_TAG"
echo "Running tag '$CIRCLE_TAG'"
else
tag="$CIRCLE_BRANCH"
echo "Running on branch '$CI_COMMIT_BRANCH'"
fi
The condition -z "$CIRCLE_TAG" means "if CIRCLE_TAG is empty" (i.e., building a branch, not a tag). But when CIRCLE_TAG is empty, the code sets tag="$CIRCLE_TAG" (empty) and says "Running tag". When CIRCLE_TAG is NOT empty (building a tag), it sets tag="$CIRCLE_BRANCH" and says "Running on branch".
Additionally, the else branch echoes $CI_COMMIT_BRANCH, which is a GitLab variable, not a Circle CI variable.
Why this matters
A reader copying this example would get incorrect behavior:
- When building a tag, it would use the branch name instead of the tag
- When building a branch, it would use an empty tag value
- The echo statements would be misleading
- The GitLab variable reference would be undefined in Circle CI
Suggested fix
Invert the conditional logic and fix the variable reference:
- run: |
if [[ -z "$CIRCLE_TAG" ]]; then
tag="$CIRCLE_BRANCH"
echo "Running on branch '$CIRCLE_BRANCH'"
else
tag="$CIRCLE_TAG"
echo "Running tag '$CIRCLE_TAG'"
fi
echo "tag = $tag"
Found by nightly documentation quality scanner
File:
content/manuals/scout/integrations/environment/cli.mdIssue
The Circle CI example has inverted conditional logic that would cause it to use the wrong variable:
The condition
-z "$CIRCLE_TAG"means "if CIRCLE_TAG is empty" (i.e., building a branch, not a tag). But when CIRCLE_TAG is empty, the code setstag="$CIRCLE_TAG"(empty) and says "Running tag". When CIRCLE_TAG is NOT empty (building a tag), it setstag="$CIRCLE_BRANCH"and says "Running on branch".Additionally, the else branch echoes
$CI_COMMIT_BRANCH, which is a GitLab variable, not a Circle CI variable.Why this matters
A reader copying this example would get incorrect behavior:
Suggested fix
Invert the conditional logic and fix the variable reference:
Found by nightly documentation quality scanner