Skip to content

Commit 5505858

Browse files
committed
Use conservative env var brace wrapping in "Check License" workflow
Even if it works as intended, it is not clear what the effect is of the escaped quote at the end of the environment variables in the shell commands used to check the license detection results. Wrapping the variable names in braces ensures they are as expected and also makes the working of the code clear.
1 parent 6066d9c commit 5505858

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/check-license.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ jobs:
5252
5353
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
5454
echo "Detected license file: $DETECTED_LICENSE_FILE"
55-
if [ "$DETECTED_LICENSE_FILE" != "\"$EXPECTED_LICENSE_FILENAME\"" ]; then
55+
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
5656
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
5757
EXIT_STATUS=1
5858
fi
5959
6060
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
6161
echo "Detected license type: $DETECTED_LICENSE_TYPE"
62-
if [ "$DETECTED_LICENSE_TYPE" != "\"$EXPECTED_LICENSE_TYPE\"" ]; then
62+
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
6363
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
6464
EXIT_STATUS=1
6565
fi

0 commit comments

Comments
 (0)