]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
.gitlab-ci.yml: docker:dockerhub: avoid SIGPIPE docs-ci-dockerhub-65qf47/deployments/9495 1859/head
authorAleš Mrázek <ales.mrazek@nic.cz>
Tue, 7 Jul 2026 10:59:17 +0000 (12:59 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Tue, 7 Jul 2026 10:59:17 +0000 (12:59 +0200)
Replaced the piped 'git tag | head' command with 'git for-each-ref'
to avoid intermittent exit code 141 failures in CI.

.gitlab-ci.yml

index 49406cfff4fa2d71adf60719320beb8791a56f7e..84ca21d3072a90d7c2d439bbc78facb8d9c7fd4b 100644 (file)
@@ -288,7 +288,10 @@ docker:dockerhub:
   before_script:
     - git fetch --tags --force
     - >
-      LATEST_TAG=$(git tag --sort=-v:refname | head -n 1)
+      LATEST_TAG=$(git for-each-ref \
+        --sort=-version:refname \
+        --count=1 \
+        --format='%(refname:short)' refs/tags)
 
       echo "Latest tag: $LATEST_TAG"
       echo "Current: $CI_COMMIT_REF_NAME"