From 93388577df97d2e3ca5df1baa5f38f5493c9ea8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Sun, 21 Apr 2024 17:50:41 +0200 Subject: [PATCH] fix --- .../tekton.dev_v1_Pipeline_auto-ci-push.yaml | 3 +++ .../tekton.dev_v1beta1_Task_git-version.yaml | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml index 7e68df0..22be96a 100644 --- a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml @@ -113,6 +113,9 @@ spec: workspace: ssh - name: git-version runAfter: [git-clone] + params: + - name: branch + value: $(params.branch-name) taskRef: name: git-version workspaces: diff --git a/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml b/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml index 444c131..db8c1bd 100644 --- a/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml @@ -19,6 +19,8 @@ spec: default: gittools/gitversion:6.0.0-alpine.3.18-7.0 description: The name of the toolbox image type: string + - name: branch + type: string results: - description: The calculated git version you could use for git tagging e.g. "0.1.0-tektonize.1-188" name: gitVersion @@ -31,8 +33,7 @@ spec: workingDir: $(workspaces.source.path) script: | #!/usr/bin/env ash - git branch - git log + git checkout $(params.branch) ShortSha=$(/tools/dotnet-gitversion . /showvariable ShortSha) echo -n "${ShortSha}" | tee $(results.shortSHA.path) FullSemVer=$(/tools/dotnet-gitversion . /showvariable FullSemVer)