This commit is contained in:
2024-04-21 17:50:41 +02:00
parent dd86eca939
commit 93388577df
2 changed files with 6 additions and 2 deletions

View File

@@ -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:

View File

@@ -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)