diff --git a/Jenkinsfile b/Jenkinsfile index a5f7206..360c774 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -131,7 +131,7 @@ pipeline { done git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ push master --tags - git ls-remote --tags master | awk '{print $2}' | sed -e 's#refs/tags/##' -e 's/\^{}$//' | sort -u | while read tag; do + git ls-remote --tags master | awk '{print $2}' | sed 's#refs/tags/##' | cut -d'^' -f1 | sort -u | while read tag; do if [ -n "$tag" ] && ! git show-ref --tags --verify --quiet "refs/tags/$tag"; then git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ push master ":refs/tags/$tag"