diff --git a/task/verify-source/0.1/tests/test-verify-source-no-vsa.yaml b/task/verify-source/0.1/tests/test-verify-source-no-vsa.yaml index 1990d84bef..d8174a2878 100644 --- a/task/verify-source/0.1/tests/test-verify-source-no-vsa.yaml +++ b/task/verify-source/0.1/tests/test-verify-source-no-vsa.yaml @@ -37,9 +37,9 @@ spec: #!/usr/bin/env sh set -eux - # Strip trailing newlines from results - LEVEL=$(echo "$SLSA_LEVEL_ACHIEVED" | tr -d '\n') - OUTPUT=$(echo "$TEST_OUTPUT" | tr -d '\n') + # Task should return results without trailing newlines + LEVEL="$SLSA_LEVEL_ACHIEVED" + OUTPUT="$TEST_OUTPUT" echo "SLSA_SOURCE_LEVEL_ACHIEVED: $LEVEL" echo "TEST_OUTPUT: $OUTPUT" diff --git a/task/verify-source/0.1/tests/test-verify-source-with-vsa.yaml b/task/verify-source/0.1/tests/test-verify-source-with-vsa.yaml index f54b0a39c4..3b2d51fc08 100644 --- a/task/verify-source/0.1/tests/test-verify-source-with-vsa.yaml +++ b/task/verify-source/0.1/tests/test-verify-source-with-vsa.yaml @@ -37,9 +37,9 @@ spec: #!/usr/bin/env sh set -eux - # Strip trailing newlines from results - LEVEL=$(echo "$SLSA_LEVEL_ACHIEVED" | tr -d '\n') - OUTPUT=$(echo "$TEST_OUTPUT" | tr -d '\n') + # Task should return results without trailing newlines + LEVEL="$SLSA_LEVEL_ACHIEVED" + OUTPUT="$TEST_OUTPUT" echo "SLSA_SOURCE_LEVEL_ACHIEVED: $LEVEL" echo "TEST_OUTPUT: $OUTPUT" diff --git a/task/verify-source/0.1/verify-source.yaml b/task/verify-source/0.1/verify-source.yaml index ffdf7e0797..b050e13ec3 100644 --- a/task/verify-source/0.1/verify-source.yaml +++ b/task/verify-source/0.1/verify-source.yaml @@ -175,9 +175,9 @@ spec: EOF ) - # Write results - echo "$ACHIEVED_LEVEL" >"$(results.SLSA_SOURCE_LEVEL_ACHIEVED.path)" - echo "$TEST_OUTPUT" >"$(results.TEST_OUTPUT.path)" + # Write results (without trailing newlines) + printf '%s' "$ACHIEVED_LEVEL" >"$(results.SLSA_SOURCE_LEVEL_ACHIEVED.path)" + printf '%s' "$TEST_OUTPUT" >"$(results.TEST_OUTPUT.path)" echo "=== SLSA Verification Summary ===" echo "Result: $VERIFICATION_RESULT"