From 98d997a4c9259f397ff9fd8d35873bc5d1c3cf9a Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Catoire Date: Thu, 21 May 2026 16:56:09 +0200 Subject: [PATCH] Fix tag/branch logic in Circle CI and GitLab environment examples The Circle CI example had inverted conditionals (it set the tag from the empty variable and used a GitLab variable in the branch echo), and the GitLab example printed echoes that didn't match the branch taken. Align each branch of the conditionals with its echo and use the provider's own variables. Fixes #25081 Fixes #25082 --- .../scout/integrations/environment/cli.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/manuals/scout/integrations/environment/cli.md b/content/manuals/scout/integrations/environment/cli.md index 233515e5b910..97093f49eaec 100644 --- a/content/manuals/scout/integrations/environment/cli.md +++ b/content/manuals/scout/integrations/environment/cli.md @@ -38,12 +38,12 @@ jobs: steps: - run: | if [[ -z "$CIRCLE_TAG" ]]; then + tag="$CIRCLE_BRANCH" + echo "Running on branch '$CIRCLE_BRANCH'" + else tag="$CIRCLE_TAG" echo "Running tag '$CIRCLE_TAG'" - else - tag="$CIRCLE_BRANCH" - echo "Running on branch '$CI_COMMIT_BRANCH'" - fi + fi echo "tag = $tag" - run: docker run -it \ -e DOCKER_SCOUT_HUB_USER=$DOCKER_SCOUT_HUB_USER \ @@ -67,12 +67,12 @@ record_environment: script: - | 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 + else + tag="$CI_COMMIT_TAG" + echo "Running tag '$CI_COMMIT_TAG'" + fi echo "tag = $tag" - environment --org "PRODUCTION" ${image}:${tag} ```