From e1e1fe72ec6ce27c3822755819746b2c47221618 Mon Sep 17 00:00:00 2001 From: Willi Date: Thu, 29 Aug 2024 15:15:11 +0530 Subject: [PATCH] debug: fixes syntax error --- .github/workflows/test_common.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_common.yml b/.github/workflows/test_common.yml index 5664ad8f85..0aaaf8c257 100644 --- a/.github/workflows/test_common.yml +++ b/.github/workflows/test_common.yml @@ -94,16 +94,17 @@ jobs: run: | substring="dbt" if echo "$DLT_SECRETS_TOML" | grep -q "$substring"; then - echo "substring found: $substring" - result=$(echo "$DLT_SECRETS_TOML" | awk -v substr="$substring" '{split($0, a, substr); print substr a[2]}' | cut -c 1-21) + echo "Substring found: $substring" + result=$(echo "$DLT_SECRETS_TOML" | sed -n "s/.*$substring\(.\{0,10\}\).*/\1/p") echo "First characters after the substring: $result" else echo "Substring $substring not found" fi + substring="ghp_KZC" if echo "$DLT_SECRETS_TOML" | grep -q "$substring"; then echo "substring found: $substring" - result=$(echo "$DLT_SECRETS_TOML" | awk -v substr="$substring" '{split($0, a, substr); print substr a[2]}' | cut -c 1-21) + result=$(echo "$DLT_SECRETS_TOML" | sed -n "s/.*$substring\(.\{0,21\}\).*/\1/p") echo "First characters after the substring: $result" else echo "Substring $substring not found" @@ -112,7 +113,7 @@ jobs: substring="sources.rest_api_pipeline.github" if echo "$DLT_SECRETS_TOML" | grep -q "$substring"; then echo "substring found: $substring" - result=$(echo "$DLT_SECRETS_TOML" | awk -v substr="$substring" '{split($0, a, substr); print substr a[2]}' | cut -c 1-21) + result=$(echo "$DLT_SECRETS_TOML" | sed -n "s/.*$substring\(.\{0,21\}\).*/\1/p") echo "First characters after the substring: $result" else echo "Substring $substring not found" @@ -122,7 +123,7 @@ jobs: substring="sources.rest_api_pipeline.github" if echo "$SECRETS_FILE" | grep -q "$substring"; then echo "substring found: $substring" - result=$(echo "$SECRETS_FILE" | awk -v substr="$substring" '{split($0, a, substr); print substr a[2]}' | cut -c 1-21) + result=$(echo "$SECRETS_FILE" | sed -n "s/.*$substring\(.\{0,21\}\).*/\1/p") echo "First characters after the substring: $result" else echo "Substring $substring not found"