Skip to content

Commit cb3f621

Browse files
RaphaelButclaude
andcommitted
Strip newlines from git URL and revision results
The git-clone task was failing with 'invalid refspec' because the revision had a trailing newline. Use tr -d '\n' to strip newlines. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 1cba6b5 commit cb3f621

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.tekton/pr-check-pipeline.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ spec:
3131
# Install jq
3232
yum install -y jq >/dev/null 2>&1
3333
34-
# Parse SNAPSHOT
35-
echo '$(params.SNAPSHOT)' | jq -r '.components[0].source.git.url' | tee $(results.git-url.path)
36-
echo '$(params.SNAPSHOT)' | jq -r '.components[0].source.git.revision' | tee $(results.git-revision.path)
34+
# Parse SNAPSHOT and write results (tr -d '\n' removes newlines)
35+
echo '$(params.SNAPSHOT)' | jq -r '.components[0].source.git.url' | tr -d '\n' > $(results.git-url.path)
36+
echo '$(params.SNAPSHOT)' | jq -r '.components[0].source.git.revision' | tr -d '\n' > $(results.git-revision.path)
37+
38+
# Debug output
39+
echo "Git URL: $(cat $(results.git-url.path))"
40+
echo "Git revision: $(cat $(results.git-revision.path))"
3741
params:
3842
- name: SNAPSHOT
3943
value: $(params.SNAPSHOT)

0 commit comments

Comments
 (0)