Skip to content

Commit b73f32e

Browse files
Address review feedback: remove ERR trap, use printf over echo
- Remove ERR trap from test file — doesn't fire inside functions without errtrace, consistent with test_helpers.sh (PR #13). - Use printf '%s\n' instead of echo for piping match string to sed, avoiding issues with -n or escape sequences. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
1 parent 1d815b8 commit b73f32e

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

get-workflow-ref/resolve_ref.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939
if [[ "$match" == *"./.github/workflows"* ]]; then
4040
ref="${REF}"
4141
else
42-
ref="$(echo "$match" | sed 's/.*@//' | awk '{print $1}')"
42+
ref="$(printf '%s\n' "$match" | sed 's/.*@//' | awk '{print $1}')"
4343
fi
4444

4545
if [ -z "$ref" ]; then

get-workflow-ref/resolve_ref_test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22
# Tests for resolve_ref.sh
33
set -euo pipefail
4-
trap 'echo "Error occurred at line $LINENO"; exit 1' ERR
54

65
cd "$(dirname "${BASH_SOURCE[0]}")"
76
SCRIPT_DIR="$PWD"

0 commit comments

Comments
 (0)