diff --git a/argo-workflows/build.yaml b/argo-workflows/build.yaml index 4772dfe..8c83393 100644 --- a/argo-workflows/build.yaml +++ b/argo-workflows/build.yaml @@ -36,8 +36,6 @@ spec: value: "{{workflow.parameters.repo}}" - name: branch value: "{{workflow.parameters.branch}}" - - - name: get-git-sha - template: get-git-sha - - name: tests template: tests - - name: build-test-and-push-image @@ -45,7 +43,7 @@ spec: arguments: parameters: - name: git-sha - value: "{{steps.get-git-sha.outputs.parameters.git-sha}}" + value: "{{steps.checkout.outputs.parameters.git-sha}}" # 📦 GIT CHECKOUT - name: checkout @@ -55,28 +53,13 @@ spec: - name: branch container: image: alpine/git + command: [sh,-c] workingDir: /workspace args: - - clone - - --depth - - "1" - - --branch - - "{{inputs.parameters.branch}}" - - --single-branch - - "{{inputs.parameters.repo}}" - - repo - volumeMounts: - - name: workspace - mountPath: /workspace - -# Get sha of the latest commit - - name: get-git-sha - script: - image: alpine/git - command: [sh] - workingDir: /workspace/repo - source: | - git rev-parse HEAD > /tmp/gitsha.txt + - | + git clone --depth 1 --branch "{{inputs.parameters.branch}}" --single-branch "{{inputs.parameters.repo}}" repo + cd repo + git rev-parse HEAD > /tmp/gitsha.txt volumeMounts: - name: workspace mountPath: /workspace