diff --git a/.github/workflows/cs-update-push.yml b/.github/workflows/cs-update-push.yml index 2b6c7e2..0e38c67 100644 --- a/.github/workflows/cs-update-push.yml +++ b/.github/workflows/cs-update-push.yml @@ -34,10 +34,10 @@ jobs: - name: Checkout cs repo uses: actions/checkout@v4 with: - path: cs - fetch-depth: 50 #To get the topmost git tags - fetch-tags: true token: ${{ secrets.bot_build_repo_token }} #This is because we want to trigger a new build + fetch-depth: 50 #To get the topmost git tags + path: cs + # fetch-tags: true -- this doesn't work - name: Checkout deploy-tools uses: actions/checkout@v4 @@ -48,6 +48,7 @@ jobs: path: deploy-tools # token: $\{{ github.token }} # DEFAULT / Any pushes with github.token don't trigger a chained build + #To fetch tags correctly: https://github.com/actions/checkout/issues/1471#issuecomment-1755560284 - name: Increment package version and push run: | git config --global user.name 'bot-build' @@ -59,8 +60,7 @@ jobs: pwd; ls -al; cd cs; - pwd; - git --no-pager log --oneline --graph --decorate; + git fetch --prune --unshallow --tags ../deploy-tools/src/repo_to_cs.sh -m $DOCKER_BASE -t $BUILD_ID -r $REPOLIST; git push origin main; diff --git a/src/repo_to_cs.sh b/src/repo_to_cs.sh index 72589b4..4652319 100755 --- a/src/repo_to_cs.sh +++ b/src/repo_to_cs.sh @@ -1,5 +1,4 @@ #!/bin/bash -set -x; SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" echo "Script directory: $SCRIPT_DIR" @@ -39,7 +38,6 @@ main() fi done <<< "$KUST_FILES_LINES" - pwd; source $SCRIPT_DIR/repo_to_cs_basetag.sh; # cat $NEW_TAG > version; #To always allow a commit # git add version; diff --git a/src/repo_to_cs_basetag.sh b/src/repo_to_cs_basetag.sh index 715bb7c..61fc3e0 100755 --- a/src/repo_to_cs_basetag.sh +++ b/src/repo_to_cs_basetag.sh @@ -12,7 +12,7 @@ # Based on https://gist.github.com/CSTDev/08c127680e3b5fae38c051da3e489351 # Commit with a log containing #minor or #major to increment the respective version number -set -x + #get highest tag number containing at least 2 dots VERSION=`git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*"`