Skip to content

Commit 3cf9949

Browse files
committed
.github/build.sh - use ${xxx##*/} instead of awk as awk may not be installed
awk is not installed on all systems so use bash Remove prefix On branch sm-nist Changes to be committed: modified: .github/build.sh
1 parent 37a5415 commit 3cf9949

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ if [ -x "/bin/sudo" ]; then
99
fi
1010

1111
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
12-
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
12+
PR_NUMBER=${GITHUB_REF##*/}
1313
if [ "$GITHUB_BASE_REF" == "master" ]; then
1414
SUFFIX="-pr$PR_NUMBER"
1515
else
1616
SUFFIX="$GITHUB_BASE_REF-pr$PR_NUMBER"
1717
fi
1818
else
19-
BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
19+
BRANCH=$${GITHUB_REF##*/}
2020
if [ "$BRANCH" != "master" ]; then
2121
SUFFIX="$BRANCH"
2222
fi

0 commit comments

Comments
 (0)