Skip to content

Commit 74800ad

Browse files
authored
Merge branch 'openshift:main' into feature/OSD-30036
2 parents 2e3f4bb + 43f8970 commit 74800ad

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

hack/investigation-test-coverage.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ GREEN='\033[0;32m'
66
RED='\033[0;31m'
77
NC='\033[0m'
88

9-
base_sha=$(echo "$CLONEREFS_OPTIONS" | grep -o '"base_sha":"[^"]*"' | cut -d':' -f2 | tr -d '"' )
9+
BASE_SHA=$(git ls-remote "https://github.com/openshift/configuration-anomaly-detection.git" "refs/heads/main" | awk '{print $1}')
1010

11-
if [[ -z "$base_sha" ]]; then
12-
echo -e "${RED}Could not obtain base_sha"
13-
exit 1
14-
fi
11+
PR_SHA=$(git rev-parse HEAD)
1512

1613
# Obtaining instances of files added in the PR
17-
diff_files=$(git diff --name-status "$base_sha" HEAD | grep '^A' | awk '{print $2}')
14+
diff_files=$(git diff --name-status "$BASE_SHA" "$PR_SHA" | grep '^A' | awk '{print $2}')
1815

1916
# Filter to relevant directory (investigations folder)
2017
investigations=$(echo "$diff_files" | grep '^pkg/investigations/' || true)

0 commit comments

Comments
 (0)